Skip to content

Commit 5830953

Browse files
committed
Add deploy-wasm-preview job for GitHub Pages release
Introduced a new workflow job that deploys the Emscripten-WASM artifact to GitHub Pages on release events. The job prepares the site content, uploads it as a Pages artifact, and handles deployment with proper permissions and environment configuration.
1 parent 78c03cc commit 5830953

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,36 @@ jobs:
106106
file: ${{ github.workspace }}/${{ matrix.name }}.zip
107107
asset_name: FastNoise2-${{ github.event.release.tag_name }}-${{ matrix.name }}.zip
108108
tag: ${{ github.ref }}
109+
110+
deploy-wasm-preview:
111+
name: Deploy WASM Preview
112+
needs: ci-matrix
113+
if: github.event_name == 'release'
114+
runs-on: ubuntu-latest
115+
permissions:
116+
pages: write
117+
id-token: write
118+
environment:
119+
name: github-pages
120+
url: ${{ steps.deployment.outputs.page_url }}
121+
steps:
122+
- name: 'Download WASM artifact'
123+
uses: actions/download-artifact@v4
124+
with:
125+
name: Emscripten-WASM
126+
path: wasm-artifact
127+
128+
- name: 'Prepare Pages content'
129+
run: |
130+
mkdir pages
131+
cp wasm-artifact/FastNoise2/bin/* pages/
132+
mv pages/NodeEditor.html pages/index.html
133+
134+
- name: 'Upload Pages artifact'
135+
uses: actions/upload-pages-artifact@v3
136+
with:
137+
path: pages
138+
139+
- name: 'Deploy to GitHub Pages'
140+
id: deployment
141+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)