File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Tag Based Image Build
22
33on :
4- create : # This listens to create events, which includes tag creations
4+ release :
5+ types : [created] # This listens to release creation events
56
67jobs :
78 buildImageForNewTag :
8- if : startsWith(github.ref, 'refs/tags/') # Only run this job when a tag is created
99 runs-on : ubuntu-latest
10+ # Set environment variables
11+ env :
12+ LATEST_TAG : ${{ (github.event.release.target_commitish == 'main') && 'thirdweb/engine:latest' || '' }}
1013
1114 steps :
1215 - name : Check Disk Space Before Build
1720
1821 - name : Checkout code
1922 uses : actions/checkout@v2
23+ with :
24+ # Fetches the branch at which the release was made
25+ ref : ${{ github.event.release.target_commitish }}
2026
2127 - name : Set up Docker Buildx
2228 uses : docker/setup-buildx-action@v1
@@ -35,10 +41,10 @@ jobs:
3541 platforms : linux/amd64,linux/arm64
3642 push : true
3743 tags : |
38- thirdweb/engine:${{ github.ref_name }}
39- thirdweb/engine:latest
44+ thirdweb/engine:${{ github.event.release.tag_name }}
45+ ${{ env.LATEST_TAG }}
4046 build-args : |
41- ENGINE_VERSION=${{ github.ref_name }}
47+ ENGINE_VERSION=${{ github.event.release.tag_name }}
4248
4349 - name : Check Disk Space After Build
4450 run : df -h
You can’t perform that action at this time.
0 commit comments