Merge pull request #27 from GzInFes/patch-18 #55
This file contains hidden or 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 Docsify to GitHub Pages | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_run: | |
| workflows: ["pages build and deployment"] | |
| types: [completed] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: docs-generated-pages | |
| cancel-in-progress: true | |
| jobs: | |
| deploy: | |
| name: Deploy static Docsify site | |
| if: >- | |
| github.event_name != 'workflow_run' || | |
| (github.event.workflow_run.conclusion == 'success' && | |
| github.event.workflow_run.head_branch == 'main') | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.workflow_run.head_sha || github.sha }} | |
| fetch-depth: 0 | |
| - name: Configure GitHub Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Test site scripts | |
| run: | | |
| node scripts/markdown-components.test.mjs | |
| node scripts/external-favicons.test.mjs | |
| node scripts/navigation-scope.test.mjs | |
| node scripts/stamp-cache-version.test.mjs | |
| - name: Generate Markdown modification records | |
| run: node scripts/generate-last-modified.mjs | |
| - name: Discover external favicons | |
| run: node scripts/generate-external-favicons.mjs | |
| - name: Prepare static site | |
| run: | | |
| mkdir -p "$RUNNER_TEMP/docs-site" | |
| rsync -a \ | |
| --exclude '.git/' \ | |
| --exclude '.github/' \ | |
| --exclude '.idea/' \ | |
| --exclude '.impeccable/' \ | |
| --exclude 'scripts/' \ | |
| --exclude 'DESIGN.md' \ | |
| --exclude 'PRODUCT.md' \ | |
| --exclude 'README.md' \ | |
| ./ "$RUNNER_TEMP/docs-site/" | |
| - name: Stamp deploy cache version | |
| env: | |
| DEPLOY_COMMIT_SHA: ${{ github.event.workflow_run.head_sha || github.sha }} | |
| run: node scripts/stamp-cache-version.mjs "$RUNNER_TEMP/docs-site" "$DEPLOY_COMMIT_SHA" | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ${{ runner.temp }}/docs-site | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |