1414 - " re2-prod-*"
1515
1616permissions :
17+ id-token : write
1718 packages : write
1819 contents : read
1920
3536 env :
3637 DOCKER_BUILDKIT : " 1"
3738 steps :
39+ - name : 🏭 Setup Depot CLI
40+ uses : depot/setup-action@v1
41+
3842 - name : ⬇️ Checkout git repo
3943 uses : actions/checkout@v4
4044
@@ -49,47 +53,37 @@ jobs:
4953 fi
5054 echo "repo=${repo}" >> "$GITHUB_OUTPUT"
5155
52- - id : get_tag
56+ - name : " #️⃣ Get image tag"
57+ id : get_tag
5358 uses : ./.github/actions/get-image-tag
5459 with :
5560 tag : ${{ inputs.image_tag }}
5661
57- - name : 🐋 Set up Docker Buildx
58- uses : docker/setup-buildx-action@v3
62+ - name : 📛 Set tags to push
63+ id : set_tags
64+ run : |
65+ ref_without_tag=ghcr.io/triggerdotdev/${{ steps.get_repository.outputs.repo }}
66+ image_tags=$ref_without_tag:${{ steps.get_tag.outputs.tag }}
5967
60- # ..to avoid rate limits when pulling images
61- - name : 🐳 Login to DockerHub
62- uses : docker/login-action@v3
63- with :
64- username : ${{ secrets.DOCKERHUB_USERNAME }}
65- password : ${{ secrets.DOCKERHUB_TOKEN }}
68+ # if tag is a semver, also tag it as v4
69+ if [[ "${{ steps.get_tag.outputs.is_semver }}" == true ]]; then
70+ # TODO: switch to v4 tag on GA
71+ image_tags=$image_tags,$ref_without_tag:v4-beta
72+ fi
6673
67- - name : 🚢 Build Container Image
68- run : |
69- docker build -t infra_image -f ./apps/${{ matrix.package }}/Containerfile .
74+ echo "image_tags=${image_tags}" >> "$GITHUB_OUTPUT"
7075
71- # ..to push image
7276 - name : 🐙 Login to GitHub Container Registry
7377 uses : docker/login-action@v3
7478 with :
7579 registry : ghcr.io
7680 username : ${{ github.repository_owner }}
7781 password : ${{ secrets.GITHUB_TOKEN }}
7882
79- - name : 🐙 Push to GitHub Container Registry
80- run : |
81- docker tag infra_image "$REGISTRY/$REPOSITORY:$IMAGE_TAG"
82- docker push "$REGISTRY/$REPOSITORY:$IMAGE_TAG"
83- env :
84- REGISTRY : ghcr.io/triggerdotdev
85- REPOSITORY : ${{ steps.get_repository.outputs.repo }}
86- IMAGE_TAG : ${{ steps.get_tag.outputs.tag }}
87-
88- # - name: 🐙 Push 'v3' tag to GitHub Container Registry
89- # if: steps.get_tag.outputs.is_semver == 'true'
90- # run: |
91- # docker tag infra_image "$REGISTRY/$REPOSITORY:v3"
92- # docker push "$REGISTRY/$REPOSITORY:v3"
93- # env:
94- # REGISTRY: ghcr.io/triggerdotdev
95- # REPOSITORY: ${{ steps.get_repository.outputs.repo }}
83+ - name : 🐳 Build image and push to GitHub Container Registry
84+ uses : depot/build-push-action@v1
85+ with :
86+ file : ./apps/${{ matrix.package }}/Containerfile
87+ platforms : linux/amd64,linux/arm64
88+ tags : ${{ steps.set_tags.outputs.image_tags }}
89+ push : true
0 commit comments