1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-23 05:08:34 +01:00

Compare commits

..

No commits in common. "3340a5024bc711d039c91b05e44b89e11e9d6391" and "c5f4fd27bd4d600f998eed71b2051e12ad59b00f" have entirely different histories.

3 changed files with 30 additions and 32 deletions

View file

@ -22,23 +22,7 @@ jobs:
name: demo name: demo
include-hidden-files: true include-hidden-files: true
if-no-files-found: error if-no-files-found: error
deploy-demo: build-docs:
if: github.event_name == 'push'
needs: [build-demo]
runs-on: ubuntu-latest
steps:
- name: Download demo artifact
uses: actions/download-artifact@v4
with:
name: demo
path: demo
- name: Deploy demo
# this is a beautiful way to deploy a website and i will not take any criticism
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"' demo/. ellbot@ssh.ellpeck.de:/var/www/MLEM/demo
build-deploy-docs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Clone repository - name: Clone repository
@ -60,10 +44,35 @@ jobs:
name: docs name: docs
include-hidden-files: true include-hidden-files: true
if-no-files-found: error if-no-files-found: error
- name: Deploy docs deploy:
needs: [build-demo, build-docs]
runs-on: ubuntu-latest
steps:
- name: Download demo artifact
uses: actions/download-artifact@v4
with:
name: demo
path: demo
- name: Download docs artifact
uses: actions/download-artifact@v4
with:
name: docs
path: docs
- name: Combine sites
run: |
mv docs _site
mv demo _site/demo
- name: Upload combined artifact
uses: actions/upload-artifact@v4
with:
path: _site
name: site
include-hidden-files: true
if-no-files-found: error
- name: Deploy
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
# this is a beautiful way to deploy a website and i will not take any criticism # this is a beautiful way to deploy a website and i will not take any criticism
run: | run: |
curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb && sudo dpkg -i cloudflared.deb 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 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"' --exclude /demo Docs/_site/. ellbot@ssh.ellpeck.de:/var/www/MLEM rsync -rv --delete -e 'ssh -o "ProxyCommand cloudflared access ssh --hostname %h" -o "StrictHostKeyChecking=no"' _site/. ellbot@ssh.ellpeck.de:/var/www/MLEM

View file

@ -2,16 +2,13 @@ using System.Threading.Tasks;
using Microsoft.JSInterop; using Microsoft.JSInterop;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;
using MLEM.Formatting;
using MLEM.Misc; using MLEM.Misc;
using MLEM.Ui;
using MLEM.Ui.Elements;
namespace Demos.Web.Pages; namespace Demos.Web.Pages;
public partial class Index { public partial class Index {
private GameImpl game; private Game game;
protected override async Task OnAfterRenderAsync(bool firstRender) { protected override async Task OnAfterRenderAsync(bool firstRender) {
await base.OnAfterRenderAsync(firstRender); await base.OnAfterRenderAsync(firstRender);
@ -24,11 +21,6 @@ public partial class Index {
if (this.game == null) { if (this.game == null) {
MlemPlatform.Current = new MlemPlatform.DesktopGl<TextInputEventArgs>((w, c) => w.TextInput += c); MlemPlatform.Current = new MlemPlatform.DesktopGl<TextInputEventArgs>((w, c) => w.TextInput += c);
this.game = new GameImpl(); this.game = new GameImpl();
this.game.OnLoadContent += g => g.UiSystem.Add("WebDisclaimer", new Paragraph(Anchor.BottomCenter, 1, "The Web version of MLEM's demos is still in development.\nFor the best experience, please try their Desktop and Android versions instead.") {
PositionOffset = new Vector2(0, 1),
Alignment = TextAlignment.Center,
TextScale = 0.075F
});
this.game.Run(); this.game.Run();
} }
this.game.Tick(); this.game.Tick();

View file

@ -13,10 +13,7 @@
] ]
} }
], ],
"dest": "api", "dest": "api"
"properties": {
"TargetFramework": "net8.0"
}
} }
], ],
"build": { "build": {