Skip to content

Commit 51fa7a7

Browse files
authored
Update ci.yml
1 parent 9a75f54 commit 51fa7a7

1 file changed

Lines changed: 21 additions & 19 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
name: Release Charts
2+
23
env:
34
HELM_VERSION: v3.13.0
45
CHART_NAME: lagrange-onebot
5-
6+
on:
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- 'chart/**'
12+
workflow_dispatch:
13+
614
jobs:
715
package-and-publish:
816
runs-on: ubuntu-latest
@@ -31,29 +39,23 @@ jobs:
3139
cd ${{ env.CHART_NAME }}
3240
helm dependency update
3341
34-
- name: Package Helm Chart
42+
- name: Package chart
3543
run: |
36-
helm package ./${{ env.CHART_NAME }} --destination ./packages
37-
mkdir -p gh-pages
38-
cp packages/*.tgz gh-pages/
44+
helm package chart --destination charts/
3945
4046
- name: Generate Helm repo index
4147
run: |
4248
cd gh-pages
43-
helm repo index . --url https://github.com/wu-yafeng/lagrange-chart/releases/download/$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.1.0")/
49+
helm repo index . --url https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}
4450
45-
- name: Deploy to GitHub Pages
46-
uses: peaceiris/actions-gh-pages@v3
47-
with:
48-
github_token: ${{ secrets.GITHUB_TOKEN }}
49-
publish_dir: ./gh-pages
50-
force_orphan: true
51+
- name: Setup Pages
52+
uses: actions/configure-pages@v4
5153

52-
- name: Create Release
53-
if: startsWith(github.ref, 'refs/tags/v')
54-
uses: softprops/action-gh-release@v1
54+
- name: Upload artifact
55+
uses: actions/upload-pages-artifact@v3
5556
with:
56-
files: packages/*.tgz
57-
generate_release_notes: true
58-
env:
59-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
path: charts
58+
59+
- name: Deploy to GitHub Pages
60+
id: deployment
61+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)