-
-
Notifications
You must be signed in to change notification settings - Fork 30
68 lines (58 loc) · 1.53 KB
/
release.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
63
64
65
66
67
name: Release
on:
workflow_dispatch:
push:
branches:
- '*'
tags:
- '*'
jobs:
release:
name: Build & Release
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./server
concurrency: release-${{ github.ref }}
permissions:
pages: write
id-token: write
contents: write
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install modules & build
run: |
npm ci --ignore-scripts
npm run prepack
- name: Generate docs
run: |
npm run generate-docs
- name: Release
if: github.ref == 'refs/heads/main'
id: release-package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm run semantic-release && echo "npm-success=true" >> $GITHUB_OUTPUT
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: "docs"
path: "server/docs"
- name: Upload docs to GitHub Pages
if: steps.release-package.outputs.npm-success != ''
uses: actions/upload-pages-artifact@v2
with:
name: pages-docs
path: server/docs
- name: Deploy docs to GitHub Pages
if: steps.release-package.outputs.npm-success != ''
uses: actions/deploy-pages@v2
with:
artifact_name: pages-docs