mirror of
https://github.com/jacobinwwey/obsidian-NotEMD.git
synced 2026-07-22 12:40:25 +00:00
81 lines
2 KiB
YAML
81 lines
2 KiB
YAML
name: Deploy Docusaurus to GitHub Pages
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'website/**'
|
|
- '.github/workflows/deploy-docs.yml'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: website
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 24
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build website
|
|
run: npm run build
|
|
env:
|
|
NODE_ENV: production
|
|
|
|
- name: Audit website build
|
|
run: npm run audit:build
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-pages-artifact@v5
|
|
with:
|
|
path: website/build
|
|
|
|
deploy:
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url || steps.deployment_second.outputs.page_url || steps.deployment_first.outputs.page_url }}
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment_first
|
|
continue-on-error: true
|
|
uses: actions/deploy-pages@v5
|
|
|
|
- name: Wait before Pages deploy retry
|
|
if: steps.deployment_first.outcome == 'failure'
|
|
run: sleep 45
|
|
|
|
- name: Retry deploy to GitHub Pages
|
|
id: deployment_second
|
|
if: steps.deployment_first.outcome == 'failure'
|
|
continue-on-error: true
|
|
uses: actions/deploy-pages@v5
|
|
|
|
- name: Wait before final Pages deploy retry
|
|
if: steps.deployment_first.outcome == 'failure' && steps.deployment_second.outcome == 'failure'
|
|
run: sleep 90
|
|
|
|
- name: Final deploy to GitHub Pages
|
|
id: deployment
|
|
if: steps.deployment_first.outcome == 'failure' && steps.deployment_second.outcome == 'failure'
|
|
uses: actions/deploy-pages@v5
|