Update scaffold #10
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 scaffold | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 */15 * *" | |
jobs: | |
copy_files: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out destination repository (pingcap-docs-website-scaffold) | |
uses: actions/checkout@v3 | |
with: | |
path: pingcap-docs-website-scaffold | |
- name: Check out source repository (pingcap/docs-staging) | |
uses: actions/checkout@v3 | |
with: | |
repository: 'pingcap/docs-staging' | |
path: docs-staging | |
- name: Run copy script | |
run: | | |
#!/bin/bash | |
src="docs-staging/markdown-pages/" | |
dest="pingcap-docs-website-scaffold/markdown-pages/" | |
rsync -av --delete --checksum --include='*/' --include='TOC.md' --include='_index.md' --include='_docHome.md' --exclude='*' "$src" "$dest" | |
cp docs-staging/docs.json pingcap-docs-website-scaffold/ | |
- name: Commit and push changes | |
run: | | |
cd docs-staging | |
last_commit=$(git rev-parse HEAD) | |
cd ../pingcap-docs-website-scaffold | |
git status | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add -A | |
git commit -m "Update files from https://github.com/pingcap/docs-staging/commit/$last_commit" || echo "No changes to commit" | |
git push |