-
Notifications
You must be signed in to change notification settings - Fork 66
61 lines (59 loc) · 1.69 KB
/
build-reloader-image.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
60
61
name: Build Reloader Image
on:
push:
branches:
- main
- "main-*"
tags:
- "*"
paths:
- sidecar/reloader/**
jobs:
build-reloader-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get reloader image version
id: version
run: |
VERSION=$(cat sidecar/reloader/VERSION)
echo "::set-output name=version::${VERSION}"
- name: Get container registry
id: registry
run: |
if [ ${{ github.ref_type }} = "tag" ]; then
echo "::set-output name=registry::docker.io"
else
echo "::set-output name=registry::ghcr.io"
fi
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
if: github.ref_type == 'tag'
with:
registry: docker.io
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- uses: docker/login-action@v2
if: github.ref_type == 'branch'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/metadata-action@v4
id: meta
with:
images: ${{ steps.registry.outputs.registry }}/${{ github.repository }}-reloader
flavor: |
latest=true
tags: |
type=semver,pattern={{version}},value=${{ steps.version.outputs.version }}
- uses: docker/build-push-action@v3
with:
push: true
pull: true
no-cache: true
platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
context: sidecar/reloader