Skip to content

Tag Based Image Build #11

Tag Based Image Build

Tag Based Image Build #11

name: Tag Based Image Build
on:
create: # This listens to create events, which includes tag creations
jobs:
buildImageForNewTag:
if: startsWith(github.ref, 'refs/tags/') # Only run this job when a tag is created
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- 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/web3-api:${{ github.ref_name }} # Set the docker tag to the Git tag name