TinyLifeWeb/.github/workflows/docs.yml
2024-01-13 17:44:27 +01:00

25 lines
1 KiB
YAML

on: [push, pull_request]
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.305
- name: Build
run: cd docs && dotnet tool restore && dotnet docfx
# this is a beautiful way to deploy a website and i will not take any criticism
- name: Deploy
if: github.event_name == 'push' && github.ref_name == 'main'
run: |
curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb && sudo dpkg -i cloudflared.deb
mkdir ~/.ssh && echo "${{ secrets.ELLBOT_KEY }}" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
rsync -rv --delete -e 'ssh -o "ProxyCommand cloudflared access ssh --hostname %h" -o "StrictHostKeyChecking=no"' docs/_site/. ellbot@ssh.ellpeck.de:/var/www/tinylifedocs