From 952ad52ce6b206d4f153745bd51f02983c36e4fc Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 13 Jan 2024 17:44:27 +0100 Subject: [PATCH] also add action for docs --- .github/workflows/docs.yml | 24 ++++++++++++++++++++++++ .github/workflows/web.yml | 2 +- .woodpecker/docs.yml | 33 --------------------------------- .woodpecker/web.yml | 29 ----------------------------- 4 files changed, 25 insertions(+), 63 deletions(-) create mode 100644 .github/workflows/docs.yml delete mode 100644 .woodpecker/docs.yml delete mode 100644 .woodpecker/web.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..ff843a6 --- /dev/null +++ b/.github/workflows/docs.yml @@ -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 diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml index 21741fd..7033865 100644 --- a/.github/workflows/web.yml +++ b/.github/workflows/web.yml @@ -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 diff --git a/.woodpecker/docs.yml b/.woodpecker/docs.yml deleted file mode 100644 index d1986b3..0000000 --- a/.woodpecker/docs.yml +++ /dev/null @@ -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 diff --git a/.woodpecker/web.yml b/.woodpecker/web.yml deleted file mode 100644 index 088f39b..0000000 --- a/.woodpecker/web.yml +++ /dev/null @@ -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