2020-08-21 13:08:33 -07:00
|
|
|
#
|
|
|
|
# ACCESS_TOKEN - Personal Access Token with "public_repo" permission
|
2021-01-02 14:27:53 -08:00
|
|
|
# If there is a change to rusefi/rusefi_documentation, this action merges it to rusefi/rusefi/wiki
|
|
|
|
#
|
|
|
|
# the opposite merge is implemented as https://github.com/rusefi/rusefi/blob/master/.github/workflows/sync-wiki.yaml
|
2020-08-21 13:08:33 -07:00
|
|
|
#
|
|
|
|
|
2022-12-28 19:27:40 -08:00
|
|
|
name: Sync Wiki3
|
2020-08-17 10:57:13 -07:00
|
|
|
|
2020-08-17 11:17:17 -07:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2020-08-17 10:57:13 -07:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
sync:
|
|
|
|
runs-on: ubuntu-latest
|
2021-03-29 19:44:49 -07:00
|
|
|
if: ${{ github.actor != 'actions-user' }}
|
2020-08-17 10:57:13 -07:00
|
|
|
|
|
|
|
steps:
|
2022-12-28 19:27:40 -08:00
|
|
|
- name: Check out repo
|
2020-08-17 10:57:13 -07:00
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2021-11-14 13:23:42 -08:00
|
|
|
- name: Install mkdocs Prerequisites
|
|
|
|
run: |
|
|
|
|
sudo apt update
|
2021-11-15 09:30:53 -08:00
|
|
|
sudo apt install sshpass
|
2023-01-01 11:00:20 -08:00
|
|
|
bash ./bin/mkdocs-install.sh
|
2021-11-14 13:23:42 -08:00
|
|
|
|
|
|
|
- name: Generate static pages using mkdocs
|
|
|
|
run: |
|
2023-01-01 11:00:20 -08:00
|
|
|
bash ./bin/mkdocs-run.sh
|
2021-11-14 13:23:42 -08:00
|
|
|
|
2021-11-15 09:30:53 -08:00
|
|
|
- name: Set SSH variables
|
2021-11-14 13:23:42 -08:00
|
|
|
env:
|
|
|
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
|
|
|
|
run: |
|
|
|
|
if [ "${{github.ref}}" = "refs/heads/master" ]; then
|
2021-11-14 13:51:32 -08:00
|
|
|
echo "::set-env name=RUSEFI_SSH_SERVER::${{secrets.RUSEFI_SSH_SERVER}}";
|
|
|
|
echo "::set-env name=RUSEFI_SSH_USER::${{secrets.RUSEFI_SSH_USER}}";
|
|
|
|
echo "::set-env name=RUSEFI_SSH_PASS::${{secrets.RUSEFI_SSH_PASS}}";
|
2021-11-14 13:23:42 -08:00
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Upload static results to wiki3
|
|
|
|
run: |
|
|
|
|
cd mkdocs/
|
|
|
|
mv site wiki
|
2021-11-14 13:51:32 -08:00
|
|
|
if [ -n "$RUSEFI_SSH_SERVER" ]; then
|
2021-11-14 13:23:42 -08:00
|
|
|
echo "Uploading Wiki"
|
2021-11-14 14:03:11 -08:00
|
|
|
tar -czf - wiki | sshpass -p "$RUSEFI_SSH_PASS" ssh -o StrictHostKeyChecking=no "$RUSEFI_SSH_USER"@"$RUSEFI_SSH_SERVER" "tar -xzf - -C docs"
|
2021-11-14 13:23:42 -08:00
|
|
|
fi
|
|
|
|
[ $? -eq 0 ] || { echo "upload FAILED"; exit 1; }
|