-
Notifications
You must be signed in to change notification settings - Fork 21
98 lines (92 loc) · 3.34 KB
/
release.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Release
on:
pull_request:
branches:
- main
release:
types: [created]
permissions:
contents: read
jobs:
publish-image:
#if: startsWith(github.ref, 'refs/tags/v') == true
runs-on: ubuntu-22.04
permissions:
id-token: write # This is the key for OIDC cosign!
packages: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: sigstore/cosign-installer@main
with:
cosign-release: "v2.0.2"
- id: get_version
run: |
RELEASE_VERSION=$(echo $GITHUB_REF | sed -nE 's!refs/tags/!!p')
echo "::set-output name=release_version::$RELEASE_VERSION"
- name: Get Docker tags
id: docker_meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/loft-sh/rancher-nodeless-plugin
tags: |
type=semver,pattern={{version}}
type=raw,value=latest
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: loft-sh
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push the hooks
uses: docker/build-push-action@v4
working-directory: ./examples/hooks
id: docker_build
with:
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: "ghcr.io/loft-sh/vcluster-example-hooks:${{steps.get_version.outputs.release_version}}"
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Images digests for
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Build and push the bootstrap
id: docker_build
working-directory: ./examples/bootstrap-with-deployment
uses: docker/build-push-action@v4
with:
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: "ghcr.io/loft-sh/vcluster-example-bootstrap-bootstrap-with-deployment:${{steps.get_version.outputs.release_version}}"
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Images digests for bootstrap
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Build and push import secret
working-directory: ./examples/import-secrets
id: docker_build
uses: docker/build-push-action@v4
with:
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: "ghcr.io/loft-sh/vcluster-example-import-secrets:${{steps.get_version.outputs.release_version}}"
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Images digests for import secret
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Build and push crd sync
working-directory: ./examples/crd-sync
id: docker_build
uses: docker/build-push-action@v4
with:
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: "ghcr.io/loft-sh/vcluster-example-crd-sync:${{steps.get_version.outputs.release_version}}"
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Images digests for crd sync
run: echo ${{ steps.docker_build.outputs.digest }}