-
Notifications
You must be signed in to change notification settings - Fork 3
59 lines (51 loc) · 2.01 KB
/
build.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
48
49
50
51
52
53
54
55
56
57
58
59
name: Docker Build
on:
push:
branch: ["master"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- id: checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- id: login-ghcr
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- id: runner-metadata
run: |
: 'Finding latest GitHub Runner version'
version="$(curl -s 'https://api.github.com/repos/actions/runner/releases/latest' | jq -r .tag_name | tr -d 'v')"
printf 'version=%s\n' "${version}" >> "${GITHUB_OUTPUT}"
- id: docker-metadata
uses: docker/metadata-action@v3
with:
images: ghcr.io/major0/gh-ecs-runner
tags: |
type=semver,pattern={{version}},value=${{ steps.runner-metadata.outputs.version }}
labels: |
org.opencontainers.image.title=Containerized GitHub Runner
org.opencontainers.image.vendor=GitHub
org.opencontainers.image.version=latest
org.opencontainers.image.licenses=MIT
org.opencontainers.image.description=
org.opencontainers.image.authors=Mark Ferrell
org.opencontainers.image.source=https://github.com/major0/gh-ecs-runner.git
org.opencontainers.image.url=https://github.com/major0/gh-ecs-runner
org.opencontainers.image.base.name=docker.com/library/ubuntu
org.opencontainers.image.base.digest=sha256:8ae9bafbb64f63a50caab98fd3a5e37b3eb837a3e0780b78e5218e63193961f9
- id: build-push
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ steps.docker-metadata.outputs.tags }}
labels: ${{ steps.docker-metadata.outputs.labels }}
build-args: VERSION=${{ steps.runner-metadata.outputs.version }}
cache-from: type=registry,ref=ghcr.io/major0/gh-ecs-runner:latest
cache-to: type=inline