PUBLISH DOCS #6
Workflow file for this run
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: PUBLISH DOCS | |
| on: | |
| workflow_dispatch: | |
| workflow_call: | |
| # or set up your own custom triggers | |
| permissions: | |
| contents: write # allows the 'Commit' step without tokens | |
| jobs: | |
| get_history: # create an artifact from the existing documentation builds | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: get the gh-pages repo | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: gh-pages | |
| - name: remove all symbolic links from root if present | |
| run: | | |
| find . -maxdepth 1 -type l -delete | |
| - name: tar the existing docs from root | |
| run: | | |
| tar -cvf documentation.tar ./ | |
| - name: create a document artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: documentation | |
| path: documentation.tar | |
| retention-days: 1 | |
| build_and_deploy: # builds the distribution and then the documentation | |
| needs: get_history | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| steps: | |
| - name: Checkout src | |
| uses: actions/checkout@v5 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Download the existing documents artifact | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: documentation | |
| - run: rm -rf ./docs # delete previous docs folder present | |
| - run: mkdir ./docs # create an empty docs folder | |
| - run: tar -xf documentation.tar -C ./docs | |
| - run: rm -f documentation.tar | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Build documents | |
| run: yarn docs #set up 'docs' build script in your package.json | |
| - name: Remove all the symbolic links from docs folder | |
| run: find ./docs -type l -delete | |
| - name: Run cleanup and manage document versions | |
| run: node scripts/manage-doc-versions.js | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |