cast timespan result to int (#685) #705
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 and Publish Docker Image | |
on: | |
push: | |
branches: ["master"] | |
paths-ignore: ["**.md", "ext/**"] | |
pull_request: | |
branches: ["master"] | |
paths-ignore: ["**.md", "ext/**"] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: linux/amd64, linux/arm64 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64, linux/arm64 | |
outputs: type=oci,dest=/tmp/docker.tar | |
tags: bancho.py:${{ github.sha }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docker | |
path: /tmp/docker.tar | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
if: ${{ github.ref == 'refs/heads/master' }} | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Push to Docker Hub | |
uses: docker/build-push-action@v5 | |
if: ${{ github.ref == 'refs/heads/master' }} | |
with: | |
context: . | |
platforms: linux/amd64, linux/arm64 | |
push: true | |
tags: | | |
${{ secrets.DOCKERHUB_USERNAME }}/bancho.py:latest | |
${{ secrets.DOCKERHUB_USERNAME }}/bancho.py:${{ github.sha }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |