-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (66 loc) · 2.2 KB
/
githubActions.yml
File metadata and controls
80 lines (66 loc) · 2.2 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
name: Pull form documentation
permissions:
contents: write
on:
workflow_dispatch:
repository_dispatch:
jobs:
build:
environment: github-pages
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: "NMSUD/Form"
path: nmsud-form
ref: main
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: nmsud-form/package-lock.json
- name: Setup variables
run: |
cnameUrl=$(cat ./CNAME)
echo "CNAME_URL=${cnameUrl}"
echo "CNAME_URL=${cnameUrl}" >> $GITHUB_ENV
- name: Create output folder
run: |
mkdir pages
cp -r ./nmsud-form/public/assets ./pages
cp ./CNAME ./pages/CNAME
touch ./pages/.nojekyll
- name: Install npm packages
run: |
cd nmsud-form
npm ci
- name: Set up documentation pages
run: |
cd nmsud-form
echo "${{ env.CNAME_URL }}" > ./public/CNAME
echo "[coverage report](https://${{ env.CNAME_URL }}/coverage/index.html)" > ./docs/generated.md
echo "[view the hosted Storybook page](https://${{ env.CNAME_URL }}/storybook)" >> ./docs/generated.md
echo "" >> ./docs/generated.md
npm run docs:build
cp -r ./.vitepress/dist/. ../pages
- name: Create code coverage report
run: |
cd nmsud-form
npm run test:coverage
npm run test:coverage-badge
cp -r ./coverage ../pages/coverage
- name: Create Storybook export
run: |
cd nmsud-form
npm run storybook:build
cp -r ./storybook-static ../pages/storybook
- uses: JamesIves/github-pages-deploy-action@v4
name: Deploy to GitHub Pages
if: github.event_name != 'pull_request'
with:
folder: pages