33 workflow_call :
44jobs :
55 publish :
6- strategy :
7- fail-fast : true # when a job fails, all remaining ones will be cancelled
8- matrix :
9- runs-on : [buildjet-4vcpu-ubuntu-2204, buildjet-4vcpu-ubuntu-2204-arm]
10- name : ${{matrix.runs-on}}
11- runs-on : ${{matrix.runs-on}}
6+ runs-on : ubuntu-latest
127 outputs :
138 version : ${{ steps.get_version.outputs.version }}
149 short_sha : ${{ steps.get_commit.outputs.sha_short }}
1510 steps :
16- - name : 🐳 Login to Docker Hub
17- uses : docker/login-action@v2
18- with :
19- username : ${{ secrets.DOCKERHUB_USERNAME }}
20- password : ${{ secrets.DOCKERHUB_TOKEN }}
2111 - name : ⬇️ Checkout repo
2212 uses : actions/checkout@v3
2313 with :
@@ -43,44 +33,24 @@ jobs:
4333 echo "Invalid reference: ${GITHUB_REF}"
4434 exit 1
4535 fi
46- if [[ ${{matrix.runs-on}} == *-arm ]]; then
47- IMAGE_TAG="${IMAGE_TAG}-arm"
48- fi
4936 echo "::set-output name=version::${IMAGE_TAG}"
5037 - name : 🔢 Get the commit hash
5138 id : get_commit
5239 run : |
5340 echo ::set-output name=sha_short::$(echo ${{ github.sha }} | cut -c1-7)
5441
55- - name : 🐳 Build Docker Image
56- run : |
57- docker build -t release_build_image -f ./docker/Dockerfile .
58-
5942 - name : 🐙 Login to GitHub Container Registry
6043 uses : docker/login-action@v2
6144 with :
6245 registry : ghcr.io
6346 username : ${{ github.repository_owner }}
6447 password : ${{ secrets.GITHUB_TOKEN }}
6548
66- - name : 🐙 Push to GitHub Container Registry
67- run : |
68- docker tag release_build_image $REGISTRY/$REPOSITORY:$IMAGE_TAG
69- docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
70- env :
71- REGISTRY : ghcr.io/triggerdotdev
72- REPOSITORY : trigger.dev
73- IMAGE_TAG : ${{ steps.get_version.outputs.version }}
74-
75- - name : 🐙 Push 'latest' to GitHub Container Registry
76- if : startsWith(github.ref, 'refs/tags/v.docker')
77- run : |
78- LATEST=latest
79- if [[ ${{matrix.runs-on}} == *-arm ]]; then
80- LATEST="${LATEST}-arm"
81- fi
82- docker tag release_build_image $REGISTRY/$REPOSITORY:$LATEST
83- docker push $REGISTRY/$REPOSITORY:$LATEST
84- env :
85- REGISTRY : ghcr.io/triggerdotdev
86- REPOSITORY : trigger.dev
49+ - name : 🐳 Build image and push to GitHub Container Registry
50+ uses : depot/build-push-action@v1
51+ with :
52+ file : ./docker/Dockerfile
53+ platforms : linux/amd64,linux/arm64
54+ tags : |
55+ ghcr.io/triggerdotdev/trigger.dev:${{ steps.get_version.outputs.version }}
56+ push : true
0 commit comments