Skip to content

Sync

Sync #6

Workflow file for this run

name: Sync docs to produc-docs
on:
push:
branches:
- main
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout docs repo
uses: actions/checkout@v3
- name: Clone produc-docs repo with auth
env:
PATH_TOKEN: ${{ secrets.PATH_TOKEN }}
run: git clone https://x-access-token:${PATH_TOKEN}@github.com/Heexy/produc-docs.git producdocs
- name: Copy files
run: rsync -a --delete --exclude='.github' ./ producdocs/
shell: bash
- name: Commit and push changes
working-directory: producdocs
env:
PATH_TOKEN: ${{ secrets.PATH_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
if ! git diff --cached --quiet; then
git commit -m "Sync docs from docs repo"
git push https://x-access-token:${PATH_TOKEN}@github.com/Heexy/produc-docs.git main
else
echo "No changes to commit"
fi