diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml deleted file mode 100644 index 4d31c0e71..000000000 --- a/.github/workflows/beta.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Build on beta branch - -on: - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - ref: beta # checkout the main branch to build nightly - - - name: Check Disk Space Before Build - run: df -h - - - name: Docker Prune - run: docker system prune -af - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and Push Docker Image - uses: docker/build-push-action@v2 - with: - context: . - target: prod - platforms: linux/amd64,linux/arm64 - push: true - tags: thirdweb/engine:beta-nightly - build-args: | - ENGINE_VERSION=beta-nightly - - - name: Check Disk Space After Build - run: df -h diff --git a/.github/workflows/tagBasedImageBuild.yml b/.github/workflows/tagBasedImageBuild.yml index b34b8b0f5..a64679170 100644 --- a/.github/workflows/tagBasedImageBuild.yml +++ b/.github/workflows/tagBasedImageBuild.yml @@ -1,11 +1,11 @@ name: Tag Based Image Build on: - create: # This listens to create events, which includes tag creations + release: + types: [created] # This listens to release creation events jobs: buildImageForNewTag: - if: startsWith(github.ref, 'refs/tags/') # Only run this job when a tag is created runs-on: ubuntu-latest steps: @@ -17,6 +17,9 @@ jobs: - name: Checkout code uses: actions/checkout@v2 + with: + # Fetches the branch at which the release was made + ref: ${{ github.event.release.target_commitish }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 @@ -35,10 +38,10 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: | - thirdweb/engine:${{ github.ref_name }} - thirdweb/engine:latest + thirdweb/engine:${{ github.event.release.tag_name }} + ${{ github.event.release.target_commitish == 'main' && 'thirdweb/engine:latest' }} build-args: | - ENGINE_VERSION=${{ github.ref_name }} + ENGINE_VERSION=${{ github.event.release.tag_name }} - name: Check Disk Space After Build run: df -h