Skip to content

Commit

Permalink
sync manual and schedule and reenable sch
Browse files Browse the repository at this point in the history
  • Loading branch information
binhex committed Mar 16, 2024
1 parent e23144e commit ee2d241
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 17 deletions.
45 changes: 41 additions & 4 deletions .github/workflows/workflow-docker-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@ jobs:
retry_wait_seconds: 120
command: |
export
- name: Identify GitHub Release tag name
# tag name is generated from date with '01' appended, as there is no upstream trigger (tdb)
# for this build as it's simply on a schedule (unlike the other builds).
uses: nick-fields/retry@v2
with:
timeout_minutes: 5
max_attempts: 3
retry_wait_seconds: 120
command: |
tag=$(date +%Y%m%d01)
echo "[debug] Generated tag name is '${tag}'"
echo "tag=$tag" >> $GITHUB_OUTPUT
id: identify_github_release_tag_name
- name: Generate temporary tag name
shell: bash
run: |
Expand All @@ -75,8 +88,6 @@ jobs:
context: .
load: true
tags: ghcr.io/${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.test_tag }}
build-args: |
RELEASETAG=${{ github.event.inputs.tags }}
- name: Run tests using previously built image
shell: bash
run: |
Expand All @@ -91,6 +102,32 @@ jobs:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ github.repository }}:${{ github.event.inputs.tags }}, quay.io/${{ github.repository }}:${{ github.event.inputs.tags }}, ghcr.io/${{ github.repository }}:${{ github.event.inputs.tags }}, registry.gitlab.com/${{ github.repository }}:${{ github.event.inputs.tags }}
tags: ${{ github.repository }}:latest, ${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}, quay.io/${{ github.repository }}:latest, quay.io/${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}, ghcr.io/${{ github.repository }}:latest, ghcr.io/${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}, registry.gitlab.com/${{ github.repository }}:latest, registry.gitlab.com/${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}
build-args: |
RELEASETAG=${{ github.event.inputs.tags }}
RELEASETAG=${{ steps.identify_github_release_tag_name.outputs.tag }}
- name: Trigger build of int images
uses: nick-fields/retry@v2
with:
timeout_minutes: 30
max_attempts: 3
retry_wait_seconds: 120
command: |
# construct array of repos to trigger builds for
declare -a int_repos_array=("arch-int-vpn" "arch-int-gui" "arch-devel")
# process repos and create release (triggers action to build)
for int_repo in "${int_repos_array[@]}"; do
curl -v -i -X POST \
-H "Content-Type:application/json" \
-H \
"Authorization: token ${{ secrets.TDB_PAT }}" \
"https://api.github.com/repos/binhex/${int_repo}/releases" \
-d '{\
"tag_name": "'${{ steps.identify_github_release_tag_name.outputs.tag }}'",\
"target_commitish": "master",\
"name": "API/URL triggered release",\
"body": "'${{ steps.identify_github_release_tag_name.outputs.tag }}'",\
"draft": false,\
"prerelease": false\
}'
done
19 changes: 6 additions & 13 deletions .github/workflows/workflow-docker-schedule.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
name: workflow-docker-schedule

# on:
# schedule:
# # run at midnight on day 7 of every other month
# - cron: "0 0 7 */2 *"
# push:
# tags:
# - '*'

on:
workflow_dispatch:
inputs:
tags:
description: 'Enter tag name for test/dev image'
default: 'test'
schedule:
# run at midnight on day 7 of every other month
- cron: "0 0 7 */2 *"
push:
tags:
- '*'

jobs:
gcr-dockerhub-build-publish:
Expand Down

0 comments on commit ee2d241

Please sign in to comment.