release: 2.18.4 release notes #65
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" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
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@v4 | |
- 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 |