Browse Source

github pages with online emulator

Thomas B 1 month ago
parent
commit
a93ad1b76e
4 changed files with 79 additions and 1 deletions
  1. 1
    1
      .github/workflows/build.yml
  2. 53
    0
      .github/workflows/docs.yml
  3. 3
    0
      README.md
  4. 22
    0
      docs/index.html

+ 1
- 1
.github/workflows/build.yml View File

1
-name: rom
1
+name: ROM
2
 
2
 
3
 # build for each push and pull request
3
 # build for each push and pull request
4
 on: [push, pull_request]
4
 on: [push, pull_request]

+ 53
- 0
.github/workflows/docs.yml View File

1
+name: Web
2
+
3
+# only build single instance of docs for latest main branch
4
+on:
5
+  push:
6
+    branches:
7
+      - master
8
+
9
+jobs:
10
+  deploy:
11
+    runs-on: ubuntu-latest
12
+
13
+    permissions:
14
+      contents: write
15
+      pages: write
16
+      id-token: write
17
+
18
+    steps:
19
+      - name: Install dependencies
20
+        working-directory: ${{github.workspace}}
21
+        shell: bash
22
+        run: |
23
+          wget https://github.com/gbdk-2020/gbdk-2020/releases/download/4.4.0/gbdk-linux64.tar.gz
24
+          tar -xzf gbdk-linux64.tar.gz
25
+
26
+      - name: Checkout repo
27
+        uses: actions/checkout@v4
28
+        with:
29
+          path: repo
30
+          fetch-depth: 0
31
+
32
+      - name: Get core count
33
+        id: core_count
34
+        run : cat /proc/cpuinfo  | grep processor | wc -l
35
+
36
+      - name: Build
37
+        working-directory: ${{github.workspace}}/repo
38
+        shell: bash
39
+        run: |
40
+          make GBDK_HOME=${{github.workspace}}/gbdk GBDK_RELEASE=1 clean all -j $(nproc)
41
+          cp duality.gb docs
42
+
43
+      - name: Setup Pages
44
+        uses: actions/configure-pages@v2
45
+
46
+      - name: Upload artifact
47
+        uses: actions/upload-pages-artifact@v3
48
+        with:
49
+          path: 'docs'
50
+
51
+      - name: Deploy to GitHub Pages
52
+        id: deployment
53
+        uses: actions/deploy-pages@v4

+ 3
- 0
README.md View File

1
 # Duality
1
 # Duality
2
 
2
 
3
 ![ROM](https://github.com/xythobuz/Duality/actions/workflows/build.yml/badge.svg)
3
 ![ROM](https://github.com/xythobuz/Duality/actions/workflows/build.yml/badge.svg)
4
+![Web](https://github.com/xythobuz/Duality/actions/workflows/docs.yml/badge.svg)
4
 
5
 
5
 My first homebrew GameBoy game.
6
 My first homebrew GameBoy game.
6
 A port of the GTA San Andreas Arcade Game Duality.
7
 A port of the GTA San Andreas Arcade Game Duality.
7
 
8
 
9
+[Try it out online!](https://xythobuz.github.io/Duality)
10
+
8
 ## Getting Started
11
 ## Getting Started
9
 
12
 
10
 You need the [GBDK-2020](https://gbdk.org/docs/api/docs_getting_started.html) to build the ROM and [Gearboy](https://github.com/drhelius/Gearboy) to emulate it comfortably.
13
 You need the [GBDK-2020](https://gbdk.org/docs/api/docs_getting_started.html) to build the ROM and [Gearboy](https://github.com/drhelius/Gearboy) to emulate it comfortably.

+ 22
- 0
docs/index.html View File

1
+<html>
2
+    <head>
3
+        <style>
4
+            body, html {
5
+                margin: 0;
6
+                padding: 0;
7
+            }
8
+        </style>
9
+    </head>
10
+    <body>
11
+        <div style="width:100%;height:100%;max-width:100%">
12
+            <div id="game"></div>
13
+        </div>
14
+        <script>
15
+            EJS_player = "#game";
16
+            EJS_core = "gb";
17
+            EJS_pathtodata = "https://cdn.emulatorjs.org/stable/data/";
18
+            EJS_gameUrl = "https://xythobuz.github.io/Duality/duality.gb";
19
+        </script>
20
+        <script src="https://cdn.emulatorjs.org/stable/data/loader.js"></script>
21
+    </body>
22
+</html>

Loading…
Cancel
Save