Skip to content

4.7.0: Finalizing the software #1

4.7.0: Finalizing the software

4.7.0: Finalizing the software #1

Workflow file for this run

# Runs on PR or Release and only if Dockerfile exists and not docs being updated
name: Docker build & publish
on:
release:
types: [published]
branches:
- main
tags:
# paths-ignore:
# - 'docs/**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Check Dockerfile exists
id: dockerfile
uses: andstor/file-existence-action@v2
with:
files: "Dockerfile"
-
name: Set up QEMU
if: steps.Dockerfile.outputs.files_exists == 'true'
id: qemu
uses: docker/setup-qemu-action@v2
with:
image: tonistiigi/binfmt:latest
platforms: arm
-
name: Set up Docker Buildx
if: steps.Dockerfile.outputs.files_exists == 'true'
uses: docker/setup-buildx-action@v2
-
name: Docker meta
if: steps.Dockerfile.outputs.files_exists == 'true'
id: meta
uses: docker/metadata-action@v4
with:
images: theyosh/terrariumpi
-
name: Login to DockerHub
if: steps.Dockerfile.outputs.files_exists == 'true'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
if: steps.Dockerfile.outputs.files_exists == 'true'
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/arm/v7
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
GITHUB_SHA=${{ github.sha }}