-
Notifications
You must be signed in to change notification settings - Fork 43
75 lines (64 loc) · 2.48 KB
/
release.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: release
on:
release:
types:
- created
jobs:
release:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
id-token: write # needed for the Vault authentication
steps:
- name: "Read Vault secrets"
if: github.repository_owner == 'k3s-io'
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials username | DOCKER_USERNAME ;
secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials password | DOCKER_TOKEN ;
- name: Login to DockerHub with Rancher Secrets
if: github.repository_owner == 'k3s-io'
uses: docker/login-action@v3
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_TOKEN }}
- name: Login to DockerHub with GHA Secrets
if: github.repository_owner != 'k3s-io'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push (k3s-io)
if: github.repository_owner == 'k3s-io'
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
rancher/klipper-lb:latest
rancher/klipper-lb:${{ github.ref_name }}
ghcr.io/${{ github.repository_owner }}/klipper-lb:latest
ghcr.io/${{ github.repository_owner }}/klipper-lb:${{ github.ref_name }}
- name: Build and push (forks)
if: github.repository_owner != 'k3s-io'
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/klipper-lb:latest
${{ secrets.DOCKER_USERNAME }}/klipper-lb:${{ github.ref_name }}
ghcr.io/${{ github.repository_owner }}/klipper-lb:latest
ghcr.io/${{ github.repository_owner }}/klipper-lb:${{ github.ref_name }}