-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (69 loc) · 2.62 KB
/
Copy pathrelease-to-github-pages.yaml
File metadata and controls
76 lines (69 loc) · 2.62 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
name: Release GitHub Page
# Based on https://vitepress.dev/guide/deploy#github-pages
# Enables automatic publishing of the website to GitHub Pages from main branch.
on:
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
# using the `master` branch as the default branch.
# push:
# branches: [main]
# Allows you to run this workflow manually from the Actions tab for debugging purposes
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false
jobs:
# Build job
build:
name: Build
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
# Check out the branch
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
# Fix "Corepack must currently be enabled by running corepack enable in your terminal."
- name: Enable Corepack
run: corepack enable
# Setup Node.js with yarn support
- name: Setup Node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444
with:
node-version: "lts/*" # Ensures the latest LTS version is used
cache: yarn # npm / pnpm / yarn
# Configure GitHub Pages
- name: Setup Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b
# Install javascript dependencies with yarn
- name: Install dependencies
run: yarn install # or pnpm install / yarn install / bun install
# Build the website
- name: Build with VitePress
run: yarn run build # or pnpm docs:build / yarn docs:build / bun run docs:build
# Upload the artefact to GitHub Pages
- name: Upload artifact
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b
with:
path: web/.vitepress/dist
# Deployment job
deploy:
# Execute deployment only from master branch
if: github.ref == 'refs/heads/main'
name: Deploy
runs-on: ubuntu-latest
# Add a dependency to the build job
needs: build
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e