/ .github / workflows / gh_pages.yaml
gh_pages.yaml
 1  name: Github Pages
 2  
 3  on:
 4    push:
 5      branches:
 6        - main
 7      paths:
 8        - 'docs/**'
 9    pull_request:
10      paths:
11        - 'docs/**'
12    workflow_dispatch:
13  
14  permissions:
15    contents: read
16    pages: write
17    id-token: write
18  
19  jobs:
20    build:
21      runs-on: ubuntu-latest
22      steps:
23        - name: Checkout repository
24          uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
25  
26        - name: Setup Node.js
27          uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
28          with:
29            node-version: "25.5.0"
30  
31        - name: Install dependencies
32          run: |
33            cd docs
34            npm ci
35  
36        - name: Build documentation
37          run: |
38            cd docs
39            npm run build
40  
41        - name: Add redirect rules
42          run: echo "/ docs/documentation/getting-started/introduction 200" > docs/build/_redirects
43  
44        - name: Upload artifact
45          uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
46          with:
47            path: docs/build
48  
49    deploy:
50      needs: build
51      if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
52      runs-on: ubuntu-latest
53      steps:
54        - name: Deploy to GitHub Pages
55          id: deployment
56          uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5