From cb4a1f22e8a1a299753c255a8f6e9e52e4922563 Mon Sep 17 00:00:00 2001 From: David Holdeman Date: Sun, 14 Nov 2021 15:15:55 -0600 Subject: [PATCH] modify workflow (#169) --- .github/workflows/sync-wiki.yaml | 48 +++++++++++++++++++++----------- mkdocs/mkdocs.yaml | 12 ++++++++ 2 files changed, 44 insertions(+), 16 deletions(-) create mode 100644 mkdocs/mkdocs.yaml diff --git a/.github/workflows/sync-wiki.yaml b/.github/workflows/sync-wiki.yaml index a7147f85..e4f9c68e 100644 --- a/.github/workflows/sync-wiki.yaml +++ b/.github/workflows/sync-wiki.yaml @@ -20,22 +20,38 @@ jobs: steps: - name: Check out docs repo uses: actions/checkout@v2 - with: - fetch-depth: 0 - repository: rusefi/rusefi.wiki - persist-credentials: false - - name: Merge from rusefi_documentation + - name: Install Prerequisites run: | - git remote add technical-git https://github.com/rusefi/rusefi_documentation.git - git fetch technical-git - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git merge technical-git/master + sudo apt update + sudo apt install ncftp + pip install mkdocs mkdocs-ezlinks-plugin - - name: Push changes rusefi/rusefi wiki - uses: ad-m/github-push-action@master - with: - repository: rusefi/rusefi.wiki - github_token: ${{ secrets.ACCESS_TOKEN }} - branch: master + + - name: Generate static pages + run: | + shopt -s extglob + cd mkdocs + mkdir docs + cp -r ../!(mkdocs) docs + mkdocs build + + - name: Set FTP variables + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' + run: | + if [ "${{github.ref}}" = "refs/heads/master" ]; then + echo "::set-env name=RUSEFI_FTP_SERVER::${{secrets.RUSEFI_FTP_SERVER}}"; + echo "::set-env name=RUSEFI_DOXYGEN_FTP_USER::${{secrets.RUSEFI_DOXYGEN_FTP_USER}}"; + echo "::set-env name=RUSEFI_DOXYGEN_FTP_PASS::${{secrets.RUSEFI_DOXYGEN_FTP_PASS}}"; + fi + + - name: Upload results + run: | + cd mkdocs/ + mv site wiki + if [ -n "$RUSEFI_FTP_SERVER" ]; then + echo "Uploading Wiki" + ncftpput -R -z -m -V -u "$RUSEFI_DOXYGEN_FTP_USER" -p "$RUSEFI_DOXYGEN_FTP_PASS" "$RUSEFI_FTP_SERVER" / wiki + fi + [ $? -eq 0 ] || { echo "upload FAILED"; exit 1; } diff --git a/mkdocs/mkdocs.yaml b/mkdocs/mkdocs.yaml new file mode 100644 index 00000000..8c175b91 --- /dev/null +++ b/mkdocs/mkdocs.yaml @@ -0,0 +1,12 @@ +site_name: rusEFI Wiki +repo_url: https://github.com/rusefi/rusefi_documentation +edit_uri: edit/master/ +theme: + name: readthedocs + collapse_navigation: true +plugins: + - search + - ezlinks: + wikilinks: true +markdown_extensions: + - sane_lists