Compare commits

..

15 commits

Author SHA1 Message Date
Ell
49922d713b combine the workflows 2024-01-13 17:48:08 +01:00
Ell
952ad52ce6 also add action for docs 2024-01-13 17:44:27 +01:00
Ell
1d93dfd055 only deploy on main branch 2024-01-13 17:41:07 +01:00
Ell
da72f806b4 make rsync verbose 2024-01-13 17:37:46 +01:00
Ell
99f66ec1a4 gonna cry 2024-01-13 17:34:58 +01:00
Ell
62aa741988 combine some of these 2024-01-13 17:33:28 +01:00
Ell
ff6a532095 tested this in private so much that i thought itd just work hahahahhahaha 2024-01-13 17:24:22 +01:00
Ell
3dbdf3fea0 permissions????? hate this 2024-01-13 17:23:30 +01:00
Ell
76ce7b7826 oh no 2024-01-13 17:13:25 +01:00
Ell
f984c72192 oh no 2024-01-13 17:04:52 +01:00
Ell
908843b84a forgot that gh actions doesn't allow this 2024-01-13 17:01:07 +01:00
Ell
d7bca50207 also allow linux in gemfile 2024-01-13 16:54:12 +01:00
Ell
3f68ee804b use the correct gemfile 2024-01-13 16:52:42 +01:00
Ell
c504c7b6a1 wrong source control oops 2024-01-13 16:50:22 +01:00
Ell
37943cd8cc let's try this out 2024-01-13 16:48:40 +01:00
4 changed files with 53 additions and 62 deletions

50
.github/workflows/build.yml vendored Normal file
View file

@ -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

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

View file

@ -64,6 +64,8 @@ GEM
google-protobuf (~> 3.23)
sass-embedded (1.63.4-x64-unknown)
google-protobuf (~> 3.23)
sass-embedded (1.63.4-x86_64-linux-gnu)
google-protobuf (~> 3.23)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.4.2)
@ -73,6 +75,7 @@ PLATFORMS
x64-mingw-ucrt
x64-mingw32
x64-unknown
x86_64-linux
DEPENDENCIES
jekyll