Skip to content

Build Platform Docs #2152

Build Platform Docs

Build Platform Docs #2152

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@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- name: 'Checkout default branch to $GITHUB_WORKSPACE dir'
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: 'Setup gitsign'
uses: chainguard-dev/actions/setup-gitsign@e1c4977ad9cb32b12c5b222ec0134a22bec60bd5 # v1.6.25
- name: Authenticate to Google Cloud
id: auth
uses: step-security/google-github-auth@775fc4c80760272ef389c9f9f8d98de7db0c170d # v3.0.2
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/actions/integrate-platform-docs
with:
project_id: "${{ secrets.PROJECT_ID }}"
storage_bucket: "${{ secrets.STORAGE_BUCKET }}"
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22
- 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@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
id: cpr
with:
token: ${{ steps.octo-sts.outputs.token }}
commit-message: Update Images Reference
title: "[AutoDocs] Update Platform Docs"
body: "Platform docs autocommit"
signoff: true
labels: |
documentation
platform
automated
assignees: matthewhelmke
- name: Post failure notice to Slack
uses: step-security/action-slack-notify@7210d1a1599b9ea84d6140184222f04f1ff56070 # v2.3.6
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 }}