File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 1
1
name : Tag Based Image Build
2
2
3
3
on :
4
- create : # This listens to create events, which includes tag creations
4
+ release :
5
+ types : [created] # This listens to release creation events
5
6
6
7
jobs :
7
8
buildImageForNewTag :
8
- if : startsWith(github.ref, 'refs/tags/') # Only run this job when a tag is created
9
9
runs-on : ubuntu-latest
10
+ # Set environment variables
11
+ env :
12
+ LATEST_TAG : ${{ (github.event.release.target_commitish == 'main') && 'thirdweb/engine:latest' || '' }}
10
13
11
14
steps :
12
15
- name : Check Disk Space Before Build
17
20
18
21
- name : Checkout code
19
22
uses : actions/checkout@v2
23
+ with :
24
+ # Fetches the branch at which the release was made
25
+ ref : ${{ github.event.release.target_commitish }}
20
26
21
27
- name : Set up Docker Buildx
22
28
uses : docker/setup-buildx-action@v1
@@ -35,10 +41,10 @@ jobs:
35
41
platforms : linux/amd64,linux/arm64
36
42
push : true
37
43
tags : |
38
- thirdweb/engine:${{ github.ref_name }}
39
- thirdweb/engine:latest
44
+ thirdweb/engine:${{ github.event.release.tag_name }}
45
+ ${{ env.LATEST_TAG }}
40
46
build-args : |
41
- ENGINE_VERSION=${{ github.ref_name }}
47
+ ENGINE_VERSION=${{ github.event.release.tag_name }}
42
48
43
49
- name : Check Disk Space After Build
44
50
run : df -h
You can’t perform that action at this time.
0 commit comments