Merge pull request #48 from githubnext/docs/autoloop-go-migration-ite… #16
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 Docs | |
| on: | |
| # Keep release/manual/reusable invocations build-only: do not publish the | |
| # normal docs site. PR #21's progress-page updates are the only automatic | |
| # GitHub Pages publication path from this workflow. | |
| workflow_call: | |
| inputs: | |
| is_prerelease: | |
| description: 'Skip deploy when true (build-only). Defaults to false (deploy).' | |
| required: false | |
| type: boolean | |
| default: false | |
| release: | |
| types: [published] | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'docs/src/content/docs/progress/**' | |
| - 'docs/astro.config.mjs' | |
| pull_request: | |
| paths: ['docs/**'] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages-${{ github.ref }}" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: 'docs/package-lock.json' | |
| - name: Install dependencies | |
| working-directory: ./docs | |
| run: npm ci | |
| - name: Build documentation | |
| working-directory: ./docs | |
| run: npm run build | |
| - name: Upload build artifacts | |
| # NOTE: in a reusable workflow, github.event_name reflects the CALLER's | |
| # event (here: 'push' of a v* tag from build-release.yml), NOT | |
| # 'workflow_call'. Detect the workflow_call invocation via the tag-push | |
| # context instead. PR runs (event_name == 'pull_request') correctly | |
| # build-only because none of the three branches match. | |
| if: | | |
| github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/dist | |
| deploy: | |
| needs: build | |
| # Only PR #21 progress-page updates on main publish to GitHub Pages. | |
| # Release/manual/reusable invocations build but do not deploy normal docs. | |
| if: | | |
| github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |