Tag Based Image Build #390
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Check Disk Space Before Build | |
run: df -h | |
- name: Docker Prune | |
run: docker system prune -af | |
- 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/engine:${{ github.ref_name }} | |
thirdweb/engine:latest | |
build-args: | | |
ENGINE_VERSION=${{ github.ref_name }} | |
- name: Check Disk Space After Build | |
run: df -h |