Browse Source

ci: Attempt at autodeploying docs

main
Horst Gutmann 1 year ago
parent
commit
29cfe0dc04
No known key found for this signature in database GPG Key ID: 6F203F0D220F8E98
2 changed files with 21 additions and 1 deletions
  1. +20
    -1
      .github/workflows/main.yml
  2. +1
    -0
      mkdocs.yml

+ 20
- 1
.github/workflows/main.yml View File

@ -41,10 +41,29 @@ jobs:
AWS_REGION: ''
SOURCE_DIR: 'dist'
DEST_DIR: "releases/webmentiond/snapshots/${{ github.sha }}"
publish:
build-website:
runs-on: ubuntu-latest
needs: test
if: ${{ github.ref == 'refs/heads/main' }}
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }}
steps:
- uses: actions/checkout@v1
- name: Log into DockerHub
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Build Docker image
run: docker run --rm -w /data -v $PWD:/data zerok/mkdocs:1.1.2 mkdocs build
- run: "mkdir -p ~/.ssh && chmod 0700 ~/.ssh"
- run: "echo \"$SSH_PRIVATE_KEY\" > ~/.ssh/id_rsa && chmod 0600 ~/.ssh/id_rsa"
- name: Update website
run: "cd site && rsync -e \"ssh -o StrictHostKeyChecking=no\" -avz . www-webmentiondorg@webmentiond.org:/srv/www/webmentiond.org/www/htdocs/"
publish:
runs-on: ubuntu-latest
needs:
- test
- build-website
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v1
- name: Log into DockerHub


+ 1
- 0
mkdocs.yml View File

@ -5,6 +5,7 @@ theme:
custom_dir: docs/_theme
extra_css:
- _theme/css/custom.css
site_url: https://webmentiond.org
nav:
- Home: "index.md"
- Getting started: "getting-started.md"


Loading…
Cancel
Save