Monthly build #118
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: Build THT Release | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- '.github/workflows/build.yml' | |
- '.cache-buster' | |
- 'Dockerfile' | |
- 'bin/**' | |
- 'zsh/**' | |
jobs: | |
build: | |
name: Build THT release | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
# use a custom PAT in order to trigger other workflows with events | |
# https://github.com/stefanzweifel/git-auto-commit-action#commits-made-by-this-action-do-not-trigger-new-workflow-runs | |
token: ${{ secrets.GH_PAT }} | |
# - | |
# name: Set up QEMU # used for arm64 builds | |
# uses: docker/setup-qemu-action@v1 | |
- | |
name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- | |
name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- | |
name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ secrets.GHCR_USERNAME }} | |
password: ${{ secrets.GHCR_TOKEN }} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64 #,linux/arm64,linux/arm/v7 | |
tags: | | |
ethack/tht:latest | |
ethack/tht:${{ github.sha }} | |
ghcr.io/ethack/tht:latest | |
ghcr.io/ethack/tht:${{ github.sha }} | |
build-args: | | |
MAXMIND_LICENSE=${{ secrets.MAXMIND_LICENSE }} | |
THT_HASH=${{ github.sha }} | |
push: true | |
# Use experimental GitHub Cache API | |
# https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#cache-backend-api | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |