Skip to content

Sync external docs

Sync external docs #27

name: Sync external docs
on:
workflow_dispatch:
schedule:
- cron: "17 2 * * *"
concurrency:
group: sync-external-docs-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: write
jobs:
sync-external-docs:
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
token: ${{ secrets.OPS_TOKEN }}
fetch-depth: 0
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v7
with:
gpg_private_key: ${{ secrets.BOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.BOT_GPG_PASSPHRASE }}
git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true
- name: Setup node environment
uses: actions/setup-node@v6
with:
node-version: "20.20"
cache: yarn
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Sync upstream documentation
env:
GITHUB_TOKEN: ${{ secrets.OPS_TOKEN }}
run: yarn sync:external-docs
- name: Detect repository changes
id: changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
fi
- name: Commit synchronized documentation
uses: stefanzweifel/git-auto-commit-action@v7
if: steps.changes.outputs.changed == 'true'
with:
commit_user_name: ${{ vars.BOT_GIT_COMMITTER_NAME }}
commit_user_email: ${{ vars.BOT_GIT_COMMITTER_EMAIL }}
commit_author: ${{ vars.BOT_GIT_AUTHOR_NAME }} <${{ vars.BOT_GIT_AUTHOR_EMAIL }}>
commit_message: "chore(docs): sync external documentation"