Trigger rebuild with latest rayforce #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Deploy to GitHub Pages | |
| on: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout rayforce-wasm | |
| uses: actions/checkout@v4 | |
| - name: Checkout rayforce (source) | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: RayforceDB/rayforce | |
| path: rayforce-src | |
| - name: Setup Emscripten | |
| uses: mymindstorm/setup-emsdk@v14 | |
| with: | |
| version: 'latest' | |
| - name: Verify Emscripten | |
| run: emcc --version | |
| - name: Sync sources | |
| run: | | |
| mkdir -p src/rayforce | |
| # Copy core C sources from rayforce/core/ to src/rayforce/ | |
| cp rayforce-src/core/*.c src/rayforce/ | |
| cp rayforce-src/core/*.h src/rayforce/ | |
| - name: Build WASM | |
| run: | | |
| # Set RAYFORCE_LOCAL to the checked out source | |
| export RAYFORCE_LOCAL=$GITHUB_WORKSPACE/rayforce-src | |
| make wasm | |
| - name: Prepare deployment | |
| run: | | |
| mkdir -p _site | |
| # Copy WASM build | |
| cp dist/rayforce.js _site/ | |
| cp dist/rayforce.wasm _site/ | |
| # Copy demo page and assets | |
| cp examples/index.html _site/ | |
| cp examples/favicon.ico _site/ | |
| cp -r examples/assets _site/ | |
| # Fix paths for flat structure (dist is now in same folder) | |
| sed -i 's|../dist/rayforce.js|./rayforce.js|g' _site/index.html | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: _site | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |