-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (50 loc) · 1.77 KB
/
publish.yml
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
name: Create Release and Publish to npm
on:
push:
branches:
- main
jobs:
release:
name: Create Release and Publish to npm
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm install
- name: Test
run: npm test
- name: Run semantic-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
# Additional steps to build and publish the documentation
- name: Build documentation
run: npm run docs:build # Ensure this command correctly generates the static files
- name: Checkout documentation repo
uses: actions/checkout@v3
with:
repository: holy-sheets/holy-sheets.github.io
token: ${{ secrets.DOCS_GH_TOKEN }}
path: docs-site # Directory where the repository will be cloned
- name: Copy generated docs to docs repo
run: |
rm -rf docs-site/* # Remove old files
cp -R docs/.vitepress/dist/* docs-site/ # Adjust the path according to your build structure
- name: Commit and Push changes
run: |
cd docs-site
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "docs: update site from main repo" || echo "No changes to commit"
git push origin main # Push to the main branch