Deploy Docusaurus Site #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Docusaurus Site | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: 8 | |
run_install: false | |
- name: Install dependencies and build | |
run: pnpm install && pnpm build | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./build | |
notify-on-failure: | |
runs-on: ubuntu-latest | |
needs: [build-and-deploy] | |
if: failure() | |
steps: | |
- name: Notify failure | |
uses: "ravsamhq/[email protected]" | |
with: | |
status: failure | |
notification_title: "Docusaurus Deploy failed on ${{ github.ref_name }} - <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Failure>" | |
message_format: ":fire: *Deploy Core Documentation to Pages* in <${{ github.server_url }}/${{ github.repository }}/${{ github.ref_name }}|${{ github.repository }}>" | |
footer: "Linked Repo <${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}> | <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Failure>" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.DEPLOY_FAIL_SLACK }} |