Deploy the web page to Cloudflare Pages - #635
Merged
Merged
Conversation
New workflow '.github/workflows/wasm.yml': it builds the WebAssembly module with Emscripten, runs 'node --test wasm/tests/', and assembles the site (the page, the module and the Web Worker). Every time the Build workflow succeeds on master, it deploys the site to Cloudflare Pages. Pull requests touching the module, the page or the libraries only build and test it. Cloudflare Pages serves 'wasm/web/_headers', which sets the headers enabling 'SharedArrayBuffer' (GitHub Pages can't set them).
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #634, then #633 and #632. This PR's diff only shows the last step.
Workflow (
.github/workflows/wasm.yml)buildjob, on pull requests touchingwasm/,src/,include/,extern/orCMakeLists.txt, and before each deployment:mymindstorm/setup-emsdk, cached) and Node.js 22;--parallel 4, as the other workflows);node --test wasm/tests/;_headers, withoutserve.py.deployjob: uploads the site to Cloudflare Pages withcloudflare/wrangler-action.master, like the Python workflow's publishing, so a brokenmasteris never deployed. It can also be run manually onmaster.cloudflare-pagesenvironment, so a protection rule can be added there if wanted.python.yml: no runs for fork pull requests, and outdated pull request runs are cancelled.wasm/web/_headerssets the two headers enablingSharedArrayBufferon Cloudflare Pages.wasm/README.mddocuments the deployment.Setup required before the first deployment
packingsolver, created for direct upload: in the dashboard, Workers & Pages → Create → Pages → "Upload assets". Another name can be used by setting the repository variableCLOUDFLARE_PAGES_PROJECT.CLOUDFLARE_API_TOKENandCLOUDFLARE_ACCOUNT_ID.Testing
_headersrules applied, as Cloudflare Pages does, in headless Chromium:crossOriginIsolatedis true;master, so once this stack is retargeted tomaster.