Build Platform Docs #2019
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 Platform Docs | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - platform-docs | |
| permissions: {} | |
| jobs: | |
| integrate-platform-docs: | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'chainguard-dev/edu' | |
| permissions: | |
| contents: read # reads from the repo | |
| id-token: write # federates with GCP and Sigstore | |
| steps: | |
| - name: 'Github Actions Runner' | |
| uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 | |
| with: | |
| egress-policy: audit | |
| - name: 'Checkout default branch to $GITHUB_WORKSPACE dir' | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: 'Setup gitsign' | |
| uses: chainguard-dev/actions/setup-gitsign@0cf1221da92242205c2d9f8a63add344ebd6b304 # v1.6.1 | |
| - name: Authenticate to Google Cloud | |
| id: auth | |
| uses: step-security/google-github-auth@57c51210cb4d85d8a5d39dc4c576c79bd693f914 # v3.0.1 | |
| with: | |
| service_account: "github-chainguard-academy@chainguard-academy.iam.gserviceaccount.com" | |
| workload_identity_provider: "projects/456977358484/locations/global/workloadIdentityPools/chainguard-academy/providers/chainguard-edu" | |
| - uses: ./.github/workflows/integrate-platform-docs | |
| with: | |
| project_id: "${{ secrets.PROJECT_ID }}" | |
| storage_bucket: "${{ secrets.STORAGE_BUCKET }}" | |
| - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: 16 | |
| - name: Update themes | |
| run: git submodule update --init --recursive | |
| - name: npm install | |
| run: npm install | |
| - name: Fetch latest package mappings | |
| run: | | |
| echo "Fetching latest package mappings from dfc repository..." | |
| curl -sL https://raw.githubusercontent.com/chainguard-dev/dfc/main/pkg/dfc/builtin-mappings.yaml \ | |
| -o data/package-mappings.yaml | |
| echo "Package mappings updated successfully" | |
| ls -lh data/package-mappings.yaml | |
| - name: npm run build | |
| run: npm run build | |
| - name: Set up Octo-STS | |
| uses: chainguard-dev/octo-sts-action@6177b4481c00308b3839969c3eca88c96a91775f # v1.0.0 | |
| id: octo-sts | |
| with: | |
| scope: chainguard-dev/edu | |
| identity: edu | |
| - name: Create a PR | |
| uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0 | |
| id: cpr | |
| with: | |
| token: ${{ steps.octo-sts.outputs.token }} | |
| commit-message: Update Images Reference | |
| title: "[AutoDocs] Update Platform Docs" | |
| body: "Platform docs ${{needs.check-new-docs.outputs.latest}} autocommit" | |
| signoff: true | |
| labels: | | |
| documentation | |
| platform | |
| automated | |
| assignees: erikaheidi | |
| - name: Post failure notice to Slack | |
| uses: step-security/action-slack-notify@e04c77a65bae8b6c0373478a1cb8fd7e012637e6 # v2.3.5 | |
| if: ${{ failure() }} | |
| env: | |
| SLACK_ICON: http://github.com/chainguard-dev.png?size=48 | |
| SLACK_USERNAME: guardian | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| SLACK_CHANNEL: 'alerts-edu' | |
| SLACK_COLOR: '#8E1600' | |
| MSG_MINIMAL: 'true' | |
| SLACK_TITLE: 'AutoDocs Platform failed - ${{ github.repository }}' | |
| SLACK_MESSAGE: | | |
| For detailed logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |