Skip to content

Commit 5910784

Browse files
committed
feat: move website deployment from Netlify to GitHub Pages
Replace Netlify CI with GitHub Actions + Pages deployment for better build visibility. The build-site job builds the website on all pushes and PRs, while deploy-site only deploys to GitHub Pages on main branch pushes. Closes #810
1 parent 5ecb696 commit 5910784

2 files changed

Lines changed: 45 additions & 24 deletions

File tree

.github/workflows/build.yml

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,21 +137,62 @@ jobs:
137137
path: cli-build
138138
name: w4
139139

140-
netlify-ci:
141-
name: Run Netlify CI
140+
build-site:
141+
name: Build website
142142
runs-on: ubuntu-latest
143143

144144
steps:
145145
- uses: actions/checkout@v2
146146
with:
147147
submodules: true
148148

149-
- name: Run Netlify CI script
149+
- name: Build web devtools
150+
working-directory: devtools/web
151+
run: npm ci
152+
153+
- name: Build web runtime
154+
working-directory: runtimes/web
155+
run: |
156+
npm ci
157+
npm run build
158+
159+
- name: Build site
160+
working-directory: site
150161
run: |
151-
scripts/run-netlify-ci
162+
rm -rf static/embed
163+
cp -r ../runtimes/web/dist/slim static/embed
164+
npm ci
165+
npm run build
152166
env:
153167
NODE_OPTIONS: --openssl-legacy-provider
154168

169+
- name: Add CNAME for custom domain
170+
run: echo "wasm4.org" > site/build/CNAME
171+
172+
- name: Upload Pages artifact
173+
uses: actions/upload-pages-artifact@v3
174+
with:
175+
path: site/build
176+
177+
deploy-site:
178+
name: Deploy to GitHub Pages
179+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
180+
needs: build-site
181+
runs-on: ubuntu-latest
182+
183+
permissions:
184+
pages: write
185+
id-token: write
186+
187+
environment:
188+
name: github-pages
189+
url: ${{ steps.deployment.outputs.page_url }}
190+
191+
steps:
192+
- name: Deploy to GitHub Pages
193+
id: deployment
194+
uses: actions/deploy-pages@v4
195+
155196
release:
156197
if: startsWith(github.ref, 'refs/tags/v')
157198
name: Release

scripts/run-netlify-ci

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)