Skip to content

Commit 66fb046

Browse files
add workflow for deploying
1 parent 580ebb6 commit 66fb046

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

.github/workflows/pages.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Update Deployment
2+
3+
on:
4+
push:
5+
branches:
6+
- "*"
7+
8+
jobs:
9+
publish:
10+
permissions:
11+
contents: write
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version: '20'
21+
22+
- name: Install dependencies
23+
run: cd client && npm install
24+
25+
- name: Remove build directory from .gitignore
26+
run: sed -i '/build/d' .gitignore
27+
28+
- name: Generate your content
29+
run: npm run build:client
30+
31+
- name: Publish current workdir (which contains generated content) to GitHub Pages
32+
uses: rayluo/github-pages-overwriter@v1.3
33+
34+
with:
35+
source-directory: client
36+
target-branch: gh-pages

client/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
<div id="game">
1616
<canvas id="canvas"></canvas>
1717
</div>
18-
<script src="build/comets.js"></script>
18+
<script src="./build/comets.js"></script>
1919
</body>
2020
</html>

0 commit comments

Comments
 (0)