Repository navigation
92 lines (77 loc) · 2.09 KB
/
Copy pathdeploy-website.yml
File metadata and controls
92 lines (77 loc) · 2.09 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
name: Website
on:
pull_request:
branches:
- main
push:
branches:
- main
permissions:
contents: read
concurrency:
group: "pages-${{ github.ref }}"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
pages: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
cache-dependency-path: Website/package-lock.json
- name: Setup .NET for source API export
uses: actions/setup-dotnet@v4
with:
dotnet-version: "9.0.x"
- name: Install dependencies
working-directory: Website
run: npm ci
- name: Test API export and website guards
working-directory: Website
run: npm run test:unit
- name: Build and audit local-root website
working-directory: Website
run: npm run build
- name: Install browser
working-directory: Website
run: npx playwright install --with-deps chromium
- name: Test website interactions and content
working-directory: Website
run: npm test
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build and audit production URLs
working-directory: Website
env:
SITE_URL: ${{ steps.pages.outputs.origin }}
SITE_PATH_PREFIX: ${{ steps.pages.outputs.base_path }}
run: npm run build
- name: Upload artifact
if: github.event_name == 'push'
uses: actions/upload-pages-artifact@v3
with:
path: Website/_site
deploy:
if: github.event_name == 'push'
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4