also add action for docs

This commit is contained in:
Ell 2024-01-13 17:44:27 +01:00
parent 1d93dfd055
commit 952ad52ce6
4 changed files with 25 additions and 63 deletions

24
.github/workflows/docs.yml vendored Normal file
View file

@ -0,0 +1,24 @@
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

View file

@ -20,7 +20,7 @@ jobs:
# 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 == 'master'
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

View file

@ -1,33 +0,0 @@
when:
path:
include:
- "docs/**"
- "Changelog.md"
- "InGameNews.md"
steps:
build-docs:
image: mcr.microsoft.com/dotnet/sdk:7.0.305
commands:
- cd docs && dotnet tool restore && dotnet docfx
preview-docs:
image: woodpeckerci/plugin-surge-preview:1.3.0
when:
event: [pull_request, pull_request_closed]
settings:
path: docs/_site
surge_token:
from_secret: surge_token
forge_type: github
forge_url: https://github.com
forge_repo_token:
from_secret: github_token
deploy-docs:
image: debian:latest
when:
event: [push, manual]
branch: main
commands:
- rm -rfv /var/www/tinylifedocs/*
- cp -rv docs/_site/. /var/www/tinylifedocs
volumes:
- /var/www/tinylifedocs:/var/www/tinylifedocs

View file

@ -1,29 +0,0 @@
when:
path: "web/**"
steps:
build-web:
image: ruby:3.2.2
commands:
- cd web && bundle && bundle exec jekyll build
preview-web:
image: woodpeckerci/plugin-surge-preview:1.3.0
when:
event: [pull_request, pull_request_closed]
settings:
path: web/_site
surge_token:
from_secret: surge_token
forge_type: github
forge_url: https://github.com
forge_repo_token:
from_secret: github_token
deploy-web:
image: debian:latest
when:
- event: [push, manual]
branch: main
commands:
- rm -rfv /var/www/tinylifegame/*
- cp -rv web/_site/. /var/www/tinylifegame
volumes:
- /var/www/tinylifegame:/var/www/tinylifegame