Merge pull request #28469 from backstage/rugvip/notes #1
This file contains 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: Sync Canon Docs | |
on: | |
push: | |
branches: [master] | |
jobs: | |
sync-canon-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
with: | |
egress-policy: audit | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Use Node.js 20.x | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
with: | |
node-version: 20.x | |
registry-url: https://registry.npmjs.org/ # Needed for auth | |
- name: yarn install | |
uses: backstage/actions/yarn-install@b3c1841fd69e1658ac631afafd0fb140a2309024 # v0.6.17 | |
with: | |
cache-prefix: ${{ runner.os }}-v20.x | |
- name: Checkout backstage/canon-docs | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
repository: backstage/canon-docs | |
path: canon-external-docs | |
token: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }} | |
- name: Configure Git | |
run: | | |
git config --global user.email [email protected] | |
git config --global user.name 'Github Canon Docs workflow' | |
- name: Install dependencies | |
working-directory: canon-docs | |
run: yarn install | |
- name: Build Canon Docs | |
working-directory: canon-docs | |
run: | | |
yarn build | |
- name: Replace contents of canon-external-docs repo with docs build output | |
working-directory: canon-external-docs | |
run: | | |
git rm -rf . | |
cp -R ../canon-docs/dist/. . | |
- name: Commit to canon-storybook repo | |
working-directory: canon-external-docs | |
run: | | |
git add . | |
git commit -am "Canon Docs build for backstage/backstage@${{ github.sha }}" | |
git push |