rusefi_documentation/.github/workflows/sync-wiki3.yaml

53 lines
1.5 KiB
YAML
Raw Normal View History

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
#
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
if: ${{ github.actor != 'actions-user' }}
2020-08-17 10:57:13 -07:00
steps:
- name: Check out repo
2023-07-31 07:37:55 -07:00
uses: actions/checkout@v3
2020-08-17 10:57:13 -07:00
- name: Install mkdocs Prerequisites
run: |
sudo apt update
sudo apt install sshpass
bash ./bin/mkdocs-install.sh
- name: Generate static pages using mkdocs
run: |
bash ./bin/mkdocs-run.sh
- name: Set SSH variables
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}}";
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
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"
fi
[ $? -eq 0 ] || { echo "upload FAILED"; exit 1; }