fix: links to Anki Manual URLs containing --
#37
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
name: Publish | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- "main" | |
jobs: | |
main: | |
name: "Publish docs.ankidroid.org" | |
if: github.repository == 'ankidroid/ankidroiddocs' | |
runs-on: ubuntu-latest | |
steps: | |
- name: SSH key setup | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.DOCS_SSH_PRIVATE_KEY }} | |
- name: SSH server key setup | |
run: | | |
ssh-keyscan ankidroid.org >> ~/.ssh/known_hosts | |
shell: bash | |
- name: Git Checkout | |
uses: actions/checkout@v3 | |
- name: Prepare website directory | |
run: | | |
mkdir _site | |
cp -r img _site/ | |
cp icons/* _site/ | |
- name: Install Asciidoctor | |
run: | | |
sudo chown -R $USER /var/lib/gems/ | |
sudo chown -R $USER /usr/local/bin | |
gem install asciidoctor | |
shell: bash | |
- name: Render Docs | |
run: asciidoctor ./*.asc -D _site/ | |
- name: Copy Docs to ankidroid.org | |
run: scp -r _site/* [email protected]:/usr/share/nginx/html/ | |
shell: bash | |
- name: Restart nginx web server | |
# - why? nginx used to fail periodically requiring a restart. But who has access? How to restart? | |
# This alloww people with publish access a button-push way to force a restart if necessary, | |
# and the restart is quick enough that doing it on publish is fine. | |
run: ssh [email protected] /usr/bin/sudo /usr/sbin/service nginx restart |