Skip to content

Refactor router

Refactor router #963

Workflow file for this run

name: deploy-docs
on:
workflow_dispatch:
push:
branches:
- main
paths:
- '.github/workflows/deploy-docs.yml'
- 'website/**'
pull_request:
branches:
- main
paths:
- '.github/workflows/deploy-docs.yml'
- 'website/**'
permissions:
contents: read
jobs:
deploy:
name: Generate docs website to GitHub Pages
runs-on: ubuntu-latest
environment: deploy-docs
permissions:
contents: write
defaults:
run:
working-directory: website
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
github.com:443
registry.yarnpkg.com:443
*.githubusercontent.com:443
*.blob.core.windows.net:443
- name: Setup Node
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: 20.x
- name: Get yarn cache
id: yarn-cache
run: echo "dir=$(yarn cache dir)" > $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-website-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-website-
- run: yarn install --frozen-lockfile
- run: yarn build
env:
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
ALGOLIA_APP_ID: ${{ vars.ALGOLIA_APP_ID }}
ALGOLIA_INDEX_NAME: ${{ vars.ALGOLIA_INDEX_NAME }}
ALGOLIA_SITE_VERIFICATION: ${{ vars.ALGOLIA_SITE_VERIFICATION }}
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main' && github.event_name == 'push' && github.repository == 'project-dalec/dalec'
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/build
destination_dir: ./docs