Merge pull request #24 from AgoraIO/dependabot/github_actions/actions… #7
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 CLI docs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "docs/**" | |
| - "cmd/gendocs/**" | |
| - "internal/cli/**" | |
| - "scripts/prepare-pages-site.py" | |
| - ".github/workflows/pages.yml" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| name: Build CLI docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Verify generated command reference | |
| run: go run ./cmd/gendocs -check | |
| - name: Configure Pages | |
| uses: actions/configure-pages@v6 | |
| - name: Build Pages site | |
| uses: actions/jekyll-build-pages@v1 | |
| with: | |
| source: ./docs | |
| destination: ./_site | |
| - name: Normalize Pages artifact permissions | |
| run: sudo chown -R "$(id -u):$(id -g)" _site | |
| - name: Prepare human and agent docs | |
| run: python3 scripts/prepare-pages-site.py --source docs --site _site --env-file docs/site.env | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./_site | |
| deploy: | |
| name: Deploy CLI docs | |
| runs-on: ubuntu-latest | |
| needs: build | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 | |