sync docs from linyaps #49
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 docs from linyaps | |
on: | |
schedule: | |
- cron: "0 5 * * 1" | |
workflow_dispatch: | |
permissions: write-all | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout linyaps pages | |
uses: actions/checkout@v4 | |
with: | |
path: linyaps | |
repository: OpenAtom-Linyaps/linyaps | |
sparse-checkout: | | |
docs/pages | |
sparse-checkout-cone-mode: false | |
- name: checkout self | |
uses: actions/checkout@v4 | |
with: | |
path: self | |
sparse-checkout: | | |
en | |
guide | |
sparse-checkout-cone-mode: false | |
- name: get diff | |
run: | | |
diff -Naur self linyaps/docs/pages &> changed.txt || true | |
if [ ! -s changed.txt ]; then | |
echo "No docs have been changed, terminate normally." | |
exit 0 | |
fi | |
cp -r linyaps/docs/pages/en/* self/en/ | |
cp -r linyaps/docs/pages/guide/* self/guide/ | |
- name: create pr | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
path: self | |
commit-message: "sync docs automatically." | |
title: "Sync docs from linyaps" | |
delete-branch: true |