doc_changes_branches #410
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: 'Update docs branch' | |
on: | |
repository_dispatch: | |
types: [doc_changes_branches] | |
permissions: {} | |
jobs: | |
update-docs: | |
runs-on: ubuntu-latest | |
environment: docs-updater | |
steps: | |
- name: Generate GitHub App token | |
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1 | |
id: generate-token | |
with: | |
creds: ${{ secrets.DOCS_UPDATER_GH_APP_CREDS }} | |
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag: v4.1.2 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
- name: Switch branches | |
# We switch to the version branch or create a new one if needed | |
run: git fetch origin && git checkout -t origin/v${{ github.event.client_payload.branch}} || git checkout -b v${{ github.event.client_payload.branch}} | |
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # tag: v4.0.2 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
uses: bahmutov/npm-install@237ded403e6012a48281f4572eab0c8eafe55b3f # tag: v1.10.1 | |
- name: Prebuild | |
run: | | |
'yarn pre-build ${{ github.event.client_payload.sha }}' | |
git add . | |
- name: Push changes | |
uses: dsanders11/github-app-commit-action@48d2ff8c1a855eb15d16afa97ae12616456d7cbc # v1.4.0 | |
with: | |
message: 'chore: update ref to docs (🤖)' | |
token: ${{ steps.generate-token.outputs.token }} |