This repository was archived by the owner on Oct 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (39 loc) · 1.47 KB
/
Copy pathbuild_runner.yaml
File metadata and controls
40 lines (39 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Janky way of rebuilding images when myoung34/github-runner:latest changes
name: Build the runner on push or if the base image has changed (on a schedule)
on:
push:
branches:
- "master"
paths:
- "runner/**"
schedule:
- cron: "30 */6 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login
uses: docker/login-action@v1.8.0
with:
username: joeshearn
password: ${{ secrets.dockerhub_pass }}
- run: echo ${{github.event_name}}
- run: echo ${{github.event_name == 'push'}}
- run: |
docker pull myoung34/github-runner:latest
BASE_ID="$(docker image ls myoung34/github-runner:latest --format '{{.ID}}')"
SHOULD_RELEASE=0
if ! curl https://registry.hub.docker.com/v1/repositories/joeshearn/action-runner-sideloaded-config/tags | jq '.[].name' | grep $BASE_ID; then
SHOULD_RELEASE=1
fi
TAG="$(printf %06d $GITHUB_RUN_NUMBER)_$BASE_ID"
echo "TAG=$TAG" | tee -a $GITHUB_ENV
echo "SHOULD_RELEASE=$SHOULD_RELEASE" | tee -a $GITHUB_ENV
- name: Build and push Docker image
if: github.event_name == 'push' || env.SHOULD_RELEASE == '1'
uses: docker/build-push-action@v2.3.0
with:
context: ./runner
tags: joeshearn/action-runner-sideloaded-config:${{ env.TAG }},joeshearn/action-runner-sideloaded-config:latest
push: "true"