-
Notifications
You must be signed in to change notification settings - Fork 44
51 lines (51 loc) · 1.81 KB
/
Copy pathrelease.yaml
File metadata and controls
51 lines (51 loc) · 1.81 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: release
on:
release:
types: [published]
permissions:
contents: read
packages: write
id-token: write
defaults:
run:
shell: bash
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Clone the code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #v7.0.0
- name: Setup Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e #v7.0.0
with:
go-version-file: go.mod
cache: false
- name: Set up Docker
uses: docker/setup-docker-action@6d7cfa65f60a9dda7b46e5513fa982536f3c9877 #v5.3.0
with:
daemon-config: |
{
"features": {
"containerd-snapshotter": true
}
}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c #v4.2.0
with:
driver: docker
- name: Login to GitHub Container Registry
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 #v4.4.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
run: |
IMG_REF=$(make build-image-multiarch IMG_REPOSITORY=${{ github.repository_owner }}/netbird-operator IMG_TAG=${{ github.event.release.tag_name }}) || exit 1
docker push ${IMG_REF}
- name: Build and push Helm chart
run: |
HELM_VERSION="${{ github.event.release.tag_name }}"
HELM_VERSION="${HELM_VERSION#v}"
helm package --app-version ${{ github.event.release.tag_name }} --version ${HELM_VERSION} charts/netbird-operator
helm push netbird-operator-${HELM_VERSION}.tgz oci://ghcr.io/${{ github.repository_owner }}/helm-charts