-
Notifications
You must be signed in to change notification settings - Fork 7
89 lines (86 loc) · 2.72 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
name: Release
on:
push:
branches: [main]
permissions:
contents: read
packages: write
id-token: write
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22.5.0
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Install Cosign
uses: sigstore/[email protected]
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build assets
run: pnpm install && pnpm build
env:
VITE_COMMIT_SHA: ${{ github.sha }}
- name: Tag image
uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=${{ github.sha }}
type=raw,value=latest
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: apps/webapp
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VITE_COMMIT_SHA=${{ github.sha }}
- name: Sign image
run: |
cosign sign --yes --key env://COSIGN_PRIVATE_KEY ghcr.io/${{ github.repository }}:${{ github.sha }}
cosign sign --yes --key env://COSIGN_PRIVATE_KEY ghcr.io/${{ github.repository }}:latest
env:
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
helm:
runs-on: ubuntu-latest
needs: [docker]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Cosign
uses: sigstore/[email protected]
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Update image tag in values.yaml
uses: fjogeleit/yaml-update-action@main
with:
valueFile: helm/mergeable/values.yaml
propertyPath: image.tag
value: ${{ github.sha }}
commitChange: false
- name: Package chart
run: helm package helm/mergeable --version 0.0.${{ github.run_number }} --destination dist
- name: Push chart
run: helm push dist/*.tgz oci://ghcr.io/pvcnt/helm