88 default : ' test'
99
1010jobs :
11- gcr-dockerhub-build-publish :
12- runs-on : ubuntu-latest
13- steps :
14- - name : Checkout
15- uses : actions/checkout@v4
16- - name : Set up QEMU for multi-arch support
17- uses : docker/setup-qemu-action@v3
18- - name : Set up Docker Buildx
19- uses : docker/setup-buildx-action@v3
20- - name : Login to Docker Hub
21- uses : docker/login-action@v3
22- with :
23- username : ${{ secrets.DOCKERHUB_USERNAME }}
24- password : ${{ secrets.DOCKERHUB_TOKEN }}
25- - name : Login to GitHub
26- uses : docker/login-action@v3
27- with :
28- registry : ghcr.io
29- username : ${{ github.repository_owner }}
30- password : ${{ secrets.CR_PAT }}
31- - name : Login to Quay
32- uses : docker/login-action@v3
33- with :
34- registry : quay.io
35- username : ${{ secrets.QUAY_USERNAME }}
36- password : ${{ secrets.QUAY_TOKEN }}
37- - name : Login to GitLab
38- uses : docker/login-action@v3
39- with :
40- registry : registry.gitlab.com
41- username : ${{ secrets.GITLAB_USERNAME }}
42- password : ${{ secrets.GITLAB_TOKEN }}
43- - name : Sync GitHub README.md with Docker Hub
44- uses : peter-evans/dockerhub-description@v4
45- with :
46- username : ${{ secrets.DOCKERHUB_USERNAME }}
47- password : ${{ secrets.DOCKERHUB_PASSWORD }} # NOTE: This MUST be the password NOT the token
48- repository : ${{ github.repository }}
49- short-description : ${{ github.event.repository.description }}
50- - name : DEBUG Show Runners environment
51- shell : bash
52- run : |
53- export
54- - name : Generate temporary tag name
55- shell : bash
56- run : |
57- test_tag=$(date +%Y%m%d%H%M%S)
58- echo "[debug] Generated test tag name is '${test_tag}'"
59- echo "test_tag=$test_tag" >> $GITHUB_OUTPUT
60- id : generate_temporary_tag_name
61- - name : Generate app name
62- shell : bash
63- run : |
64- app_name=$(echo "${GITHUB_REPOSITORY}" | grep -P -o -m 1 '(?<=/arch-).*')
65- echo "[debug] Generated app name is '${app_name}'"
66- echo "app_name=$app_name" >> $GITHUB_OUTPUT
67- id : generate_app_name
68- - name : Build amd64 image and export to Docker for testing
69- uses : Wandalen/wretry.action@v3
70- with :
71- action : docker/build-push-action@v6
72- with : |
73- context: .
74- load: true
75- tags: ghcr.io/${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.test_tag }}
76- build-args: |
77- RELEASETAG=${{ github.event.inputs.tags }}
78- attempt_limit : 3
79- attempt_delay : 600000
80- - name : Run tests using previously built image
81- shell : bash
82- run : |
83- git_clone_scripts_dest="/tmp/scripts"
84- git_clone_scripts_repo="https://github.com/binhex/scripts.git"
85- git clone "${git_clone_scripts_repo}" "${git_clone_scripts_dest}"
86- "${git_clone_scripts_dest}/shell/arch/docker/testrunner.sh" --app-name ${{ steps.generate_app_name.outputs.app_name }} --image-name "ghcr.io/${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.test_tag }}"
87- # note this will re-use the internal cached amd64 image from the previous build
88- - name : Build multi-arch Docker image, tag and push to registries
89- uses : Wandalen/wretry.action@v3
90- with :
91- action : docker/build-push-action@v6
92- with : |
93- context: .
94- platforms: linux/amd64
95- push: true
96- 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 }}
97- build-args: |
98- RELEASETAG=${{ github.event.inputs.tags }}
99- attempt_limit : 3
100- attempt_delay : 600000
11+ call-reusable-workflow :
12+ uses : binhex/workflow-templates/.github/workflows/workflow-docker-manual.yml@main
13+ with :
14+ tags : ${{ github.event.inputs.tags }}
15+ secrets :
16+ CR_PAT : ${{ secrets.CR_PAT }}
17+ DOCKERHUB_PASSWORD : ${{ secrets.DOCKERHUB_PASSWORD }}
18+ DOCKERHUB_TOKEN : ${{ secrets.DOCKERHUB_TOKEN }}
19+ DOCKERHUB_USERNAME : ${{ secrets.DOCKERHUB_USERNAME }}
20+ EMAIL_ADDRESS : ${{ secrets.EMAIL_ADDRESS }}
21+ EMAIL_PASSWORD : ${{ secrets.EMAIL_PASSWORD }}
22+ GITLAB_TOKEN : ${{ secrets.GITLAB_TOKEN }}
23+ GITLAB_USERNAME : ${{ secrets.GITLAB_USERNAME }}
24+ IMMORTALITY_PAT : ${{ secrets.IMMORTALITY_PAT }}
25+ LEMMY_USERNAME : ${{ secrets.LEMMY_USERNAME }}
26+ LEMMY_PASSWORD : ${{ secrets.LEMMY_PASSWORD }}
27+ QUAY_TOKEN : ${{ secrets.QUAY_TOKEN }}
28+ QUAY_USERNAME : ${{ secrets.QUAY_USERNAME }}
29+ TDB_PAT : ${{ secrets.TDB_PAT }}
0 commit comments