-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 987 Bytes
/
build.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
name: Build and push image
on:
push:
tags:
- v*
permissions:
contents: read
id-token: write
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v22
- run: nix build .#docker
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Tag and Push
env:
GH_IMAGE: ghcr.io/${{ github.repository }}:${{ github.ref_name }}
run: |
IMAGE="$(docker load -i result | awk '{print $3}')"
docker tag "$IMAGE" "$GH_IMAGE"
docker push "$GH_IMAGE"
- uses: Azure/setup-helm@v3
- run: |
VERSION="${GITHUB_REF_NAME#v}"
helm package --version "$VERSION" --app-version "$GITHUB_REF_NAME" -d pkg/ chart/
helm push ./pkg/*.tgz "oci://ghcr.io/$GITHUB_REPOSITORY_OWNER"