Skip to content

Commit

Permalink
Update docs.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanton authored Aug 20, 2024
1 parent bf3b953 commit ac8711a
Showing 1 changed file with 42 additions and 29 deletions.
71 changes: 42 additions & 29 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,51 @@
name: deploy-docusaurus
name: Deploy to GitHub Pages

on:
push:
branches: [develop]
branches:
- develop
# 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

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
publish:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out repo
uses: actions/checkout@v4
# Node is required for npm
- name: Set up Node
uses: actions/setup-node@v4
- uses: actions/checkout@v4
with:
node-version: "18"
# Install and build Docusaurus website
- name: Build Docusaurus website
run: |
cd docs
npm install
npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Deploy to GitHub Pages
if: success()
uses: crazy-max/ghaction-github-pages@v4
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build website
run: yarn build

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
target_branch: gh-pages
build_dir: docs/build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
path: 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

0 comments on commit ac8711a

Please sign in to comment.