-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a83dbee
commit c6daf02
Showing
1 changed file
with
26 additions
and
18 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,38 @@ | ||
name: Sync psi docs to HydroRoll | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
download_pages: | ||
sync: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout HydroRoll repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Git credentials | ||
run: | | ||
git config --local user.email "actions@github.com" | ||
git config --local user.name "GitHub Actions" | ||
- name: Checkout HydroRoll | ||
uses: actions/checkout@v2 | ||
with: | ||
path: HydroRoll | ||
|
||
- name: Clone psi repository | ||
run: git clone --depth 1 https://github.com/HydroRoll-Team/psi.git | ||
- name: Clone psi repo | ||
run: | | ||
git clone https://github.com/HydroRoll-Team/psi.git | ||
- name: Copy psi/docs/pages to HydroRoll/docs/pages/psi | ||
run: cp -r psi/docs/pages HydroRoll/docs/pages/psi | ||
- name: Copy psi docs to HydroRoll | ||
run: | | ||
mkdir -p HydroRoll/docs/pages/psi | ||
cp -r psi/docs/pages/* HydroRoll/docs/pages/psi/ | ||
- name: Commit and push changes | ||
run: | | ||
cd HydroRoll | ||
git add . | ||
git commit -m "Update psi/docs/pages" | ||
git push origin main | ||
- name: Commit and push if it changed | ||
run: | | ||
cd HydroRoll | ||
git config --local user.email "action@github.com" | ||
git config --local user.name "GitHub Action" | ||
git add -A | ||
if git diff --quiet HEAD; then | ||
echo "No changes to commit" | ||
else | ||
git commit -m "Sync psi docs" | ||
git push | ||
fi |