From 49922d713bd9b595f59b43cf244d7bcb9f71e839 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 13 Jan 2024 17:48:08 +0100 Subject: [PATCH] combine the workflows --- .github/workflows/build.yml | 50 +++++++++++++++++++++++++++++++++++++ .github/workflows/docs.yml | 24 ------------------ .github/workflows/web.yml | 27 -------------------- 3 files changed, 50 insertions(+), 51 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/docs.yml delete mode 100644 .github/workflows/web.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..5df873e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,50 @@ +on: [push, pull_request] +jobs: + web: + runs-on: ubuntu-latest + env: + BUNDLE_GEMFILE: ${{ github.workspace }}/web/Gemfile + steps: + - name: Clone repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.2.2 + bundler-cache: true + - name: Build + run: cd web && bundle exec jekyll build + + # 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"' web/_site/. ellbot@ssh.ellpeck.de:/var/www/tinylifegame + + 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/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index ff843a6..0000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,24 +0,0 @@ -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 deleted file mode 100644 index 7033865..0000000 --- a/.github/workflows/web.yml +++ /dev/null @@ -1,27 +0,0 @@ -on: [push, pull_request] -jobs: - web: - runs-on: ubuntu-latest - env: - BUNDLE_GEMFILE: ${{ github.workspace }}/web/Gemfile - steps: - - name: Clone repository - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.2.2 - bundler-cache: true - - name: Build - run: cd web && bundle exec jekyll build - - # 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"' web/_site/. ellbot@ssh.ellpeck.de:/var/www/tinylifegame