Publish Backstage TechDocs #865
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 Backstage TechDocs' | |
| on: | |
| workflow_dispatch: | |
| # Run Daily at 10:00 UTC time | |
| schedule: | |
| - cron: '0 10 * * *' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| publish-techdocs-site: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: 'read' | |
| id-token: 'write' | |
| steps: | |
| - name: Checkout Backstage | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| repository: backstage/backstage | |
| fetch-depth: 1 | |
| - name: Setup Node | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | |
| with: | |
| node-version: 24.x | |
| registry-url: https://registry.npmjs.org/ # Needed for auth | |
| - name: Setup Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 | |
| with: | |
| python-version: '3.14' | |
| - name: Install techdocs-cli | |
| run: sudo npm install -g @techdocs/cli | |
| - name: Install MkDocs and MkDocs Plugins | |
| run: python -m pip install mkdocs-techdocs-core==1.* | |
| - name: Clean Up Readmes | |
| run: | | |
| for i in README*.md; do | |
| sed -i 's|docs/assets|assets|g' $i | |
| sed -i 's|README.md|index.md|g' $i | |
| done | |
| - name: Copy Translated Readmes | |
| run: | | |
| mv README-*.md docs | |
| - name: Generate TechDocs | |
| run: techdocs-cli generate --no-docker --legacyCopyReadmeMdToIndexMd --verbose | |
| - name: Login to Google Cloud Services | |
| uses: 'google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093' # v3 | |
| with: | |
| credentials_json: ${{ secrets.TECHDOCS_GCS_CREDENTIALS_JSON }} | |
| - name: Publish TechDocs | |
| run: techdocs-cli publish --publisher-type googleGcs --storage-name ${{ secrets.TECHDOCS_GCS_BUCKET }} --entity default/component/backstage |