📝 chore(deploy_gh-pages.yml): add GitHub Actions workflow to deploy to GitHub Pages
This commit adds a new GitHub Actions workflow file, `deploy_gh-pages.yml`, which is responsible for deploying the project to GitHub Pages. The workflow is triggered on pushes to the `lf-docs-fix` branch. The workflow consists of the following steps: 1. Checkout the repository 2. Set up Node.js environment with version 18 and npm caching 3. Install dependencies for the documentation 4. Build the website 5. Deploy the built website to GitHub Pages using the `peaceiris/actions-gh-pages` action - The deployment is done to the `gh-pages` branch - The build output is published from the `./docs/build` directory - The commit authorship is assigned to the official GH-Actions bot This workflow enables automatic deployment of the documentation to GitHub Pages whenever changes are pushed to the `lf-docs-fix` branch.
This commit is contained in:
parent
7034660af2
commit
2de7fe1c13
1 changed files with 38 additions and 0 deletions
38
.github/workflows/deploy_gh-pages.yml
vendored
Normal file
38
.github/workflows/deploy_gh-pages.yml
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
name: Deploy to GitHub Pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- lf-docs-fix
|
||||
# Review gh actions docs if you want to further define triggers, paths, etc
|
||||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy to GitHub Pages
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
run: cd docs && npm install
|
||||
- name: Build website
|
||||
run: cd docs && npm run build
|
||||
|
||||
# Popular action to deploy to GitHub Pages:
|
||||
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Build output to publish to the `gh-pages` branch:
|
||||
publish_dir: ./docs/build
|
||||
# The following lines assign commit authorship to the official
|
||||
# GH-Actions bot for deploys to `gh-pages` branch:
|
||||
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
|
||||
# The GH actions bot is used by default if you didn't specify the two fields.
|
||||
# You can swap them out with your own user credentials.
|
||||
Loading…
Add table
Add a link
Reference in a new issue