3535 env :
3636 DOCKER_BUILDKIT : " 1"
3737 steps :
38+ - name : 🏭 Setup Depot CLI
39+ uses : depot/setup-action@v1
40+
3841 - name : ⬇️ Checkout git repo
3942 uses : actions/checkout@v4
4043
@@ -49,47 +52,37 @@ jobs:
4952 fi
5053 echo "repo=${repo}" >> "$GITHUB_OUTPUT"
5154
52- - id : get_tag
55+ - name : " #️⃣ Get image tag"
56+ id : get_tag
5357 uses : ./.github/actions/get-image-tag
5458 with :
5559 tag : ${{ inputs.image_tag }}
5660
57- - name : 🐋 Set up Docker Buildx
58- uses : docker/setup-buildx-action@v3
61+ - name : 📛 Set tags to push
62+ id : set_tags
63+ run : |
64+ ref_without_tag=ghcr.io/triggerdotdev/${{ steps.get_repository.outputs.repo }}
65+ image_tags=$ref_without_tag:${{ steps.get_tag.outputs.tag }}
5966
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 }}
67+ # if tag is a semver, also tag it as v4
68+ if [[ "${{ steps.get_tag.outputs.is_semver }}" == true ]]; then
69+ # TODO: switch to v4 tag on GA
70+ image_tags=$image_tags,$ref_without_tag:v4-beta
71+ fi
6672
67- - name : 🚢 Build Container Image
68- run : |
69- docker build -t infra_image -f ./apps/${{ matrix.package }}/Containerfile .
73+ echo "image_tags=${image_tags}" >> "$GITHUB_OUTPUT"
7074
71- # ..to push image
7275 - name : 🐙 Login to GitHub Container Registry
7376 uses : docker/login-action@v3
7477 with :
7578 registry : ghcr.io
7679 username : ${{ github.repository_owner }}
7780 password : ${{ secrets.GITHUB_TOKEN }}
7881
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 }}
82+ - name : 🐳 Build image and push to GitHub Container Registry
83+ uses : depot/build-push-action@v1
84+ with :
85+ file : ./apps/${{ matrix.package }}/Containerfile
86+ platforms : linux/amd64,linux/arm64
87+ tags : ${{ steps.get_tag.outputs.tag }}
88+ # push: true
0 commit comments