-
-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (57 loc) · 2.05 KB
/
publish.yml
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 images
on:
push:
branches: main
release:
types:
- published
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Quay
uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push ${{github.event.release.tag_name }}
id: docker_build_release
uses: docker/build-push-action@v6
if: ${{ github.event.release.tag_name != '' }}
with:
push: true
tags: ghcr.io/bakito/k8s-event-logger:latest,ghcr.io/bakito/k8s-event-logger:${{ github.event.release.tag_name }},quay.io/bakito/k8s-event-logger:latest,quay.io/bakito/k8s-event-logger:${{ github.event.release.tag_name }}
platforms: linux/amd64
provenance: false
build-args: VERSION=${{ github.event.release.tag_name }}
- name: Build and push main
id: docker_build_main
uses: docker/build-push-action@v6
if: ${{ github.event.release.tag_name == '' }}
with:
push: true
tags: ghcr.io/bakito/k8s-event-logger:main,quay.io/bakito/k8s-event-logger:main
platforms: linux/amd64
provenance: false
build-args: VERSION=main
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
# - name: Prune ghcr images
# uses: vlaurin/action-ghcr-prune@main
# with:
# token: ${{ secrets.PRUNE_IMAGE_TOKEN }}
# container: k8s-event-logger
# dry-run: false # Dry-run first, then change to `false`
# older-than: 7 # days
# untagged: true