Skip to content

Commit

Permalink
ci: sort out docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zkrising committed Apr 6, 2024
1 parent b883253 commit 029a5b2
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Docs CI/CD

on:
push:
branches:
- "main"
paths:
- "docs/**"
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Enable SSH Key
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
sudo chmod 600 ~/.ssh/id_rsa
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
env:
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}}

- name: Build Container
run: docker build . -t docs -f Dockerfile.docs

- name: Build Docs
run: docker run -v ./site:/site --entrypoint="mkdocs" docs build

- name: Deploy docs
run: scp -r ./site ci@"$TACHI_HOST":tachi-docs
env:
TACHI_HOST: ${{secrets.TACHI_HOST}}
7 changes: 7 additions & 0 deletions Dockerfile.docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM python:3.11-slim
RUN pip install mkdocs==1.5.3
RUN pip install mkdocs-material==9.5.17

COPY docs ./

CMD ["mkdocs", "serve"]

0 comments on commit 029a5b2

Please sign in to comment.