3
3
workflow_call :
4
4
jobs :
5
5
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
12
7
outputs :
13
8
version : ${{ steps.get_version.outputs.version }}
14
9
short_sha : ${{ steps.get_commit.outputs.sha_short }}
15
10
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 }}
21
11
- name : ⬇️ Checkout repo
22
12
uses : actions/checkout@v3
23
13
with :
@@ -43,44 +33,24 @@ jobs:
43
33
echo "Invalid reference: ${GITHUB_REF}"
44
34
exit 1
45
35
fi
46
- if [[ ${{matrix.runs-on}} == *-arm ]]; then
47
- IMAGE_TAG="${IMAGE_TAG}-arm"
48
- fi
49
36
echo "::set-output name=version::${IMAGE_TAG}"
50
37
- name : 🔢 Get the commit hash
51
38
id : get_commit
52
39
run : |
53
40
echo ::set-output name=sha_short::$(echo ${{ github.sha }} | cut -c1-7)
54
41
55
- - name : 🐳 Build Docker Image
56
- run : |
57
- docker build -t release_build_image -f ./docker/Dockerfile .
58
-
59
42
- name : 🐙 Login to GitHub Container Registry
60
43
uses : docker/login-action@v2
61
44
with :
62
45
registry : ghcr.io
63
46
username : ${{ github.repository_owner }}
64
47
password : ${{ secrets.GITHUB_TOKEN }}
65
48
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