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