-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (54 loc) · 1.76 KB
/
main.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
name: Build and deploy
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
env:
NAME: hahaha
FEATURE_REPOSITORY: oci://europe-north1-docker.pkg.dev/nais-io/nais/feature
jobs:
build_and_push:
outputs:
version: ${{ steps.build-push-sign.outputs.version }}
permissions:
contents: "read"
id-token: "write"
name: build and push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: nais/platform-build-push-sign@main
id: build-push-sign
with:
name: ${{ env.NAME }}
google_service_account: gh-${{ env.NAME }}
workload_identity_provider: ${{ secrets.NAIS_IO_WORKLOAD_IDENTITY_PROVIDER }}
multi-platform: true
push: "${{ github.ref == 'refs/heads/main' }}"
- uses: azure/setup-helm@v4
name: "Setup Helm"
with:
version: "v3.12.0"
- name: Build Chart
run: |-
yq e '.version = "${{ steps.build-push-sign.outputs.version }}"' --inplace "charts/Chart.yaml"
yq e '.image.tag = "${{ steps.build-push-sign.outputs.version }}"' --inplace "charts/values.yaml"
helm package charts
- name: Push Chart
if: github.ref == 'refs/heads/main'
run: |-
helm push ${{ env.NAME }}*.tgz ${{ env.FEATURE_REPOSITORY }}
rollout:
if: github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/main'
needs:
- build_and_push
runs-on: fasit-deploy
permissions:
id-token: write
steps:
- uses: nais/fasit-deploy@v2
with:
chart: ${{ env.FEATURE_REPOSITORY }}/${{ env.NAME }}
version: ${{ needs.build_and_push.outputs.version }}
feature_name: ${{ env.NAME }}