Skip to content

Release GitHub Page #11

Release GitHub Page

Release GitHub Page #11

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:
release:
types:
- released
# 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd
# 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@53b83947a5a98c8d113130e565377fae1a50d02f
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@45bfe0192ca1faeb007ade9deae92b16b8254a0d
# 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@fc324d3547104276b827a68afc52ff2a11cc49c9
with:
path: web/.vitepress/dist
# Deployment job
deploy:
# Execute deployment only from master branch
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
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@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128