docs: Update runner configuration in codelab #14
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: Build and Deploy Codelab | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'codelab/codelab.md' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build: | |
| name: Build Codelab | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.21' | |
| - name: Install claat | |
| run: go install github.com/googlecodelabs/tools/claat@latest | |
| - name: Build Codelab HTML | |
| run: | | |
| # Add go bin to the workflow's PATH | |
| export PATH="$PATH:$(go env GOPATH)/bin" | |
| # Run claat. | |
| claat export codelab/codelab.md | |
| # The output folder name is unchanged, it comes from the 'id' | |
| mv my-tasks-github-actions-codelab dist | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: './dist' | |
| deploy: | |
| name: Deploy Codelab | |
| needs: build | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |