Files
actions-runner-controller/.github/workflows/build-runner.yml
Hayden Fuss c986c5553d Fixing Docker Build and Push for Runner Image (#115)
A new image tag for the runner stopped being published on master merges from changes in #86.

This fixes that in the following ways:
- Tests the GH workflow on PRs w/o pushing the images
- Runner and Docker version are moved from Makefile to GH Actions workflow and are passed in as build args
- GHA workflow runs on PRs, and if the workflow file itself is changed (i.e. version bump) or the runner Docker source changes (excluding the Makefile since thats just for local dev)
- Images are pushed on push (i.e. a merge)
2020-10-09 09:16:24 +09:00

52 lines
1.4 KiB
YAML

on:
pull_request:
branches:
- '**'
paths:
- 'runner/**'
- .github/workflows/build-runner.yml
push:
branches:
- master
paths:
- runner/patched/*
- runner/Dockerfile
- runner/entrypoint.sh
- .github/workflows/build-runner.yml
name: Runner
jobs:
build:
runs-on: ubuntu-latest
name: Build
env:
RUNNER_VERSION: 2.273.5
DOCKER_VERSION: 19.03.12
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
buildx-version: latest
- name: Build Container Image
working-directory: runner
run: |
docker buildx build \
--build-arg RUNNER_VERSION=${RUNNER_VERSION} \
--build-arg DOCKER_VERSION=${DOCKER_VERSION} \
--platform linux/amd64,linux/arm64 \
--tag summerwind/actions-runner:v${RUNNER_VERSION} \
-f Dockerfile .
- name: Push Container Image
working-directory: runner
run: |
docker login -u summerwind --password-stdin <<<${{ secrets.DOCKER_ACCESS_TOKEN }}
docker push summerwind/actions-runner:v${RUNNER_VERSION}
docker tag summerwind/actions-runner:v${RUNNER_VERSION} summerwind/actions-runner:latest
docker push summerwind/actions-runner:latest
if: ${{ github.event_name == 'push' }}