-
Notifications
You must be signed in to change notification settings - Fork 1
113 lines (97 loc) · 3.13 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Publish Nx Cloud CE Release
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
#on:
# push:
# tags:
# - 'v*'
permissions: {}
jobs:
retag-oci-images:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # for creating OIDC tokens for signing.
packages: write # used to push images to `ghcr.io` if used.
strategy:
matrix:
include:
- image: ghcr.io/clementguillot/nx-cloud-ce-server
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Skopeo
uses: warjiang/setup-skopeo@71776e03c10d767c04af8924fe5a67763f9b3d34 # v0.1.3
with:
version: latest
- name: Extract tag and commit SHA
id: vars
run: |
echo "TAG=v0.0.1" >> $GITHUB_ENV
SHORT_SHA=$(git rev-parse --short $GITHUB_SHA)
echo "SHORT_SHA=${SHORT_SHA}" >> $GITHUB_ENV
- name: Sync images
run: |
skopeo --version
# skopeo copy --all --dest-creds \
# ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} \
# docker://${{ matrix.image }}:${{ env.SHORT_SHA }} \
# docker://${{ matrix.image }}:${{ env.TAG }}
publish-helm-charts:
runs-on: ubuntu-latest
permissions:
contents: write # for helm/chart-releaser-action to push chart release and create a release
packages: write # to push OCI chart package to GitHub Registry
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Set up Helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
with:
version: v3.14.4
- uses: ./.github/actions/setup-tools
- run: npx nx build apps/helm-chart
# - name: Add dependency chart repos
# run: |
# helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Run chart-releaser
uses: helm/chart-releaser-action@a917fd15b20e8b64b94d9158ad54cd6345335584 # v1.6.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_RELEASE_NAME_TEMPLATE: "helm-chart-{{ .Version }}"
with:
skip_packaging: true
# skip_existing: true
# charts_repo_url: https://charts.external-secrets.io
# generate-release-notes: true
- name: Login to GHCR
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# - name: Push chart to GHCR
# run: |
# shopt -s nullglob
# for pkg in .cr-release-packages/*.tgz; do
# if [ -z "${pkg:-}" ]; then
# break
# fi
# helm push "${pkg}" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts"
# done