-
Notifications
You must be signed in to change notification settings - Fork 2
101 lines (86 loc) · 2.82 KB
/
Copy pathrelease.yaml
File metadata and controls
101 lines (86 loc) · 2.82 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
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
name: Release Helm Chart
on:
push:
branches:
- main
paths:
- charts/s3proxy/**
jobs:
update-readme:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
ref: main
persist-credentials: false
- name: Save HEAD SHA before helm-docs
id: save-sha
run: |
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Render helm docs inside the README.md and push changes back to PR branch
uses: losisin/helm-docs-github-action@v1
with:
output-file: ../../README.md
template-files: README.md.gotmpl
git-push: false
- name: Check for README changes
id: check-changes
run: |
if git diff --quiet ${{ steps.save-sha.outputs.sha }} -- README.md
then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Commit and push
if: steps.check-changes.outputs.has_changes == 'true'
run: |
git config --global user.name "Comet Actions"
git config --global user.email "github-actions@comet.com"
# stage any file changes to be committed
git add README.md
# make commit with staged changes
git commit -m 'Update README.md with helm-docs'
- name: Push changes
if: success()
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GHA_COMMIT_TO_MASTER_PAT }}
branch: main
release:
runs-on: ubuntu-latest
needs:
- update-readme
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
ref: main
- name: Configure Git
run: |
git config --global user.name 'Github Actions (${{ github.actor }})'
git config --global user.email 'github-actions@comet.com'
- name: Copy README into Chart
run: |
cp README.md charts/s3proxy/
- name: Set up Helm
uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
with:
version: v3.19.2
- name: Build chart dependencies
# comet-common is not vendored in-repo; resolve it from Chart.lock
# (anonymous OCI pull) so chart-releaser can package the chart.
run: helm dependency build charts/s3proxy
- name: Run chart-releaser
uses: bitdeps/helm-oci-charts-releaser@v0.1.3
with:
oci_registry: ghcr.io/comet-ml
tag_name_pattern: ''
oci_username: github-actions
oci_password: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}