Build Runner Image #42
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 Runner Image | |
run-name: Build Runner Image | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- docker/** | |
- build.sh | |
- Makefile | |
- .github/workflows/build_runner_image.yml | |
# Scheduled on every 4:00 A.M. in UTC+8 on Monday. | |
schedule: | |
- cron: "0 20 * * 1" | |
workflow_dispatch: | |
concurrency: | |
group: build-runner-image-${{ github.event_name }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-runner: | |
runs-on: | |
group: github-amd64-8c32g | |
timeout-minutes: 15 | |
steps: | |
- run: sudo chown -R $(whoami) . | |
- run: git config --global --add safe.directory '*' | |
- uses: actions/checkout@v4 | |
- uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3 | |
- uses: docker/metadata-action@v5 | |
id: meta | |
with: | |
images: ghcr.io/${{ github.repository }}/runner | |
flavor: | | |
latest=true | |
tags: | | |
type=sha,prefix=sha-,suffix=,format=short | |
- uses: docker/build-push-action@v6 | |
env: | |
DOCKER_BUILD_SUMMARY: false | |
with: | |
pull: true | |
push: true | |
platforms: linux/amd64 | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
file: ./docker/Dockerfile.runner | |
context: . |