Deploy documentation to GitHub Pages #636
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 documentation to GitHub Pages | |
| on: | |
| workflow_run: | |
| workflows: ["Release updates"] | |
| types: [completed] | |
| workflow_call: | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| if: ${{ github.event_name != 'workflow_run' || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'release') }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| cache-dependency-path: docs/package.json | |
| - name: Install dependencies | |
| working-directory: ./docs | |
| run: npm install | |
| - name: Build documentation | |
| working-directory: ./docs | |
| run: npm run build | |
| - name: Create CNAME file | |
| working-directory: ./docs/dist | |
| run: echo "docs.opengatellm.org" > CNAME | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./docs/dist | |
| publish_branch: gh-pages | |
| user_name: 'github-actions[bot]' | |
| user_email: 'github-actions[bot]@users.noreply.github.com' | |
| # dns: | |
| # runs-on: ubuntu-latest | |
| # | |
| # env: | |
| # OVH_APP_KEY: ${{ secrets.OVH_APP_KEY }} | |
| # OVH_APP_SECRET: ${{ secrets.OVH_APP_SECRET }} | |
| # OVH_CONSUMER_KEY: ${{ secrets.OVH_CONSUMER_KEY }} | |
| # | |
| # steps: | |
| # - name: Checkout repository | |
| # uses: actions/checkout@v4 | |
| # | |
| # - name: Configure Python | |
| # uses: actions/setup-python@v5 | |
| # with: | |
| # python-version: '3.12' | |
| # | |
| # - name: Install dependencies | |
| # run: pip install ovh | |
| # | |
| # - name: Run DNS management script | |
| # run: python scripts/manage_docs_dns.py |