14
14
- " re2-prod-*"
15
15
16
16
permissions :
17
+ id-token : write
17
18
packages : write
18
19
contents : read
19
20
35
36
env :
36
37
DOCKER_BUILDKIT : " 1"
37
38
steps :
39
+ - name : 🏭 Setup Depot CLI
40
+ uses : depot/setup-action@v1
41
+
38
42
- name : ⬇️ Checkout git repo
39
43
uses : actions/checkout@v4
40
44
@@ -49,47 +53,37 @@ jobs:
49
53
fi
50
54
echo "repo=${repo}" >> "$GITHUB_OUTPUT"
51
55
52
- - id : get_tag
56
+ - name : " #️⃣ Get image tag"
57
+ id : get_tag
53
58
uses : ./.github/actions/get-image-tag
54
59
with :
55
60
tag : ${{ inputs.image_tag }}
56
61
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 }}
59
67
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
66
73
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"
70
75
71
- # ..to push image
72
76
- name : 🐙 Login to GitHub Container Registry
73
77
uses : docker/login-action@v3
74
78
with :
75
79
registry : ghcr.io
76
80
username : ${{ github.repository_owner }}
77
81
password : ${{ secrets.GITHUB_TOKEN }}
78
82
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