Skip to content

Commit

Permalink
ci: use action from docusaurus docs
Browse files Browse the repository at this point in the history
  • Loading branch information
h3rmanj committed Nov 4, 2024
1 parent db9d9af commit 9039184
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 10 deletions.
38 changes: 28 additions & 10 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- ".github/workflows/publish-docs.yml"

jobs:
gh-release:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -18,13 +18,31 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: cd to docusaurus
run: cd docusaurus
- name: Install dependencies
run: npm ci
- name: Build
run: |
cd docusaurus
npm ci
npm run build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docusaurus/build
run: npm run build

deploy:
name: Deploy to GitHub Pages
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
28 changes: 28 additions & 0 deletions .github/workflows/test-publish-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test deployment

on:
pull_request:
branches:
- main
# 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:
test-deploy:
name: Test deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: cd to docusaurus
run: cd docusaurus
- name: Install dependencies
run: npm ci
- name: Test build website
run: npm run build

0 comments on commit 9039184

Please sign in to comment.