mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-26 14:38:34 +01:00
Compare commits
5 commits
c5f4fd27bd
...
3340a5024b
Author | SHA1 | Date | |
---|---|---|---|
3340a5024b | |||
f22dfa0ec4 | |||
c9d7fd29df | |||
88136ab9c5 | |||
82dd677987 |
3 changed files with 32 additions and 30 deletions
47
.github/workflows/web.yml
vendored
47
.github/workflows/web.yml
vendored
|
@ -22,7 +22,23 @@ jobs:
|
||||||
name: demo
|
name: demo
|
||||||
include-hidden-files: true
|
include-hidden-files: true
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
build-docs:
|
deploy-demo:
|
||||||
|
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
|
||||||
|
@ -44,35 +60,10 @@ jobs:
|
||||||
name: docs
|
name: docs
|
||||||
include-hidden-files: true
|
include-hidden-files: true
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
deploy:
|
- name: Deploy docs
|
||||||
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"' _site/. ellbot@ssh.ellpeck.de:/var/www/MLEM
|
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
|
||||||
|
|
|
@ -2,13 +2,16 @@ 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 Game game;
|
private GameImpl game;
|
||||||
|
|
||||||
protected override async Task OnAfterRenderAsync(bool firstRender) {
|
protected override async Task OnAfterRenderAsync(bool firstRender) {
|
||||||
await base.OnAfterRenderAsync(firstRender);
|
await base.OnAfterRenderAsync(firstRender);
|
||||||
|
@ -21,6 +24,11 @@ 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();
|
||||||
|
|
|
@ -13,7 +13,10 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dest": "api"
|
"dest": "api",
|
||||||
|
"properties": {
|
||||||
|
"TargetFramework": "net8.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"build": {
|
"build": {
|
||||||
|
|
Loading…
Reference in a new issue