Skip to content

Commit 4fb6a19

Browse files
Add deploy.yml action
1 parent b42df92 commit 4fb6a19

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Generate and deploy site
2+
on:
3+
# Documentation can be either manually updated or is automatically updated when pushed to main branch
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
10+
# Make sure deploy-pages has necessary permissions to deploy to GitHub Pages
11+
permissions:
12+
pages: write
13+
id-token: write
14+
15+
# Cancel older deploy workflow when more than one is running
16+
concurrency:
17+
group: pages
18+
cancel-in-progress: true
19+
20+
jobs:
21+
deploy:
22+
name: Build and deploy documentation site
23+
runs-on: ubuntu-latest
24+
environment:
25+
name: github-pages
26+
url: ${{ steps.deploy.outputs.page_url }} # Output URL after the workflow has finished
27+
steps:
28+
# Checkout repository including submodules
29+
- name: Checkout
30+
id: checkout
31+
uses: actions/checkout@v4
32+
with:
33+
submodules: true
34+
35+
# Setup Node
36+
- name: Use Node.js 20.x
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version: 20.x
40+
cache: 'npm'
41+
42+
# Install dependencies
43+
- run: npm ci
44+
45+
# Build site
46+
- name: Build Documentation
47+
id: build
48+
run: npm run build
49+
50+
# Upload artifact from the ./build/ directory using the expected format for GitHub Pages
51+
- name: Upload Artifact
52+
id: upload
53+
uses: actions/upload-pages-artifact@v3
54+
with:
55+
path: ./build/
56+
57+
# Use previously uploaded artifact to deploy to GitHub Pages
58+
- name: Deploy
59+
id: deploy
60+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)