-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.45 KB
/
github-actions-runner.yaml
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
41
42
43
44
45
46
47
name: Build and Push Image
on:
push:
paths:
- "github-actions-runner/Dockerfile"
jobs:
build:
name: Build and push image
runs-on: ubuntu-20.04
env:
IMAGE_NAME: github-actions-runner
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- name: Read upstream tag without version
id: gettag
run: echo "::set-output name=tag::$(head -n 1 github-actions-runner/Dockerfile | awk -F':' '{print $2}' | awk -F'-' 'BEGIN { OFS="-" } {$NF=""; print $0}')"
- name: Read internal update version
id: getversion
run: echo "::set-output name=version::$(grep 'ARG RUNNER_VERSION' github-actions-runner/Dockerfile | awk -F'=' '{print $2}')"
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: latest ${{ steps.gettag.outputs.tag }}${{ steps.getversion.outputs.version }}
dockerfiles: |
./github-actions-runner/Dockerfile
- name: Push To Quay
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: quay.io/ebigxa
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Use the image
run: echo "New image has been pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"