-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (43 loc) · 1.47 KB
/
controller-images.yaml
File metadata and controls
51 lines (43 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
41
42
43
44
45
46
47
48
49
50
51
name: Build
on:
push:
tags:
- 'v*'
branches: [ main ]
jobs:
build-images:
name: Build Docker Images
runs-on: ubuntu-latest
steps:
# Check out code
- name: Checkout
uses: actions/checkout@v2
# Determine tag we will use for images
- name: Get image version
shell: bash
run: |
echo ::set-output name=tag::$([[ "${GITHUB_REF##*/}" == "main" ]] && echo latest || echo ${GITHUB_REF##*/})
id: version
# Setup QEMU
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
# Set up a buildx runner
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
buildkitd-flags: "--debug"
# Login to the container registry
- name: Login to Container Registry
run: echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
if: ${{ github.event_name != 'pull_request' }}
# Build and push the image
- name: Build and Push Controller Image
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
builder: ${{ steps.buildx.outputs.name }}
push: ${{ github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) }}
tags: ghcr.io/pelotech/jsonnet-controller:${{ steps.version.outputs.tag }}