Skip to content

Commit bb07297

Browse files
authored
Upd: Beta Updated with GH Workflow (#498)
1 parent 28103be commit bb07297

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

.github/workflows/tagBasedImageBuild.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
name: Tag Based Image Build
22

33
on:
4-
create: # This listens to create events, which includes tag creations
4+
release:
5+
types: [created] # This listens to release creation events
56

67
jobs:
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
@@ -17,6 +20,9 @@ jobs:
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

0 commit comments

Comments
 (0)