Update static.yml #13
This file contains 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
# Simple workflow for deploying static content to GitHub Pages | |
name: Deploy static content to Pages | |
on: | |
# Runs on pushes targeting the default branch | |
push: | |
branches: ["deployed"] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
# Single deploy job since we're just deploying | |
deploy: | |
environment: | |
name: static-site | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
env: | |
GITHUB_TOKEN: '' | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: splashkitonline | |
submodules: 'true' | |
env: | |
GITHUB_TOKEN: '' | |
- name: npm install | |
working-directory: ./splashkitonline/Browser_IDE | |
run: | | |
npm install | |
env: | |
GITHUB_TOKEN: '' | |
- name: shuffle folders | |
working-directory: ./splashkitonline/Browser_IDE | |
run: | | |
mv node_modules/codemirror codemirror-5.65.15 | |
mv node_modules/jszip/dist jszip | |
mv node_modules/@babel/standalone babel | |
mv node_modules/split.js/dist split.js | |
mv node_modules/mime/dist mime | |
mv ../DemoProjects DemoProjects | |
env: | |
GITHUB_TOKEN: '' | |
- name: download binaries | |
working-directory: ./splashkitonline/Browser_IDE #python3 ./setup.py | |
run: | | |
wget -O splashkit/splashkit_autocomplete.json https://raw.githubusercontent.com/WhyPenguins/SplashkitOnline/github-live/Browser_IDE/splashkit/splashkit_autocomplete.json | |
wget -O runtimes/javascript/bin/SplashKitBackendWASM.js https://raw.githubusercontent.com/WhyPenguins/SplashkitOnline/github-live/Browser_IDE/runtimes/javascript/bin/SplashKitBackendWASM.js | |
wget -O runtimes/javascript/bin/SplashKitBackendWASM.wasm https://raw.githubusercontent.com/WhyPenguins/SplashkitOnline/github-live/Browser_IDE/runtimes/javascript/bin/SplashKitBackendWASM.wasm | |
wget -O compilers/cxx/bin/wasi-sysroot.zip.lzma https://raw.githubusercontent.com/WhyPenguins/SplashkitOnline/github-live/Browser_IDE/compilers/cxx/bin/wasi-sysroot.zip.lzma | |
wget -O compilers/cxx/bin/clang++.js https://raw.githubusercontent.com/WhyPenguins/SplashkitOnline/github-live/Browser_IDE/compilers/cxx/bin/clang++.js | |
wget -O compilers/cxx/bin/clang.wasm.lzma https://raw.githubusercontent.com/WhyPenguins/SplashkitOnline/github-live/Browser_IDE/compilers/cxx/bin/clang.wasm.lzma | |
wget -O compilers/cxx/bin/wasm-ld.js https://raw.githubusercontent.com/WhyPenguins/SplashkitOnline/github-live/Browser_IDE/compilers/cxx/bin/wasm-ld.js | |
wget -O compilers/cxx/bin/lld.wasm.lzma https://raw.githubusercontent.com/WhyPenguins/SplashkitOnline/github-live/Browser_IDE/compilers/cxx/bin/lld.wasm.lzma | |
wget -O runtimes/cxx/bin/SplashKitBackendWASMCPP.js https://raw.githubusercontent.com/WhyPenguins/SplashkitOnline/github-live/Browser_IDE/runtimes/cxx/bin/SplashKitBackendWASMCPP.js | |
wget -O runtimes/cxx/bin/SplashKitBackendWASMCPP.worker.js https://raw.githubusercontent.com/WhyPenguins/SplashkitOnline/github-live/Browser_IDE/runtimes/cxx/bin/SplashKitBackendWASMCPP.worker.js | |
env: | |
GITHUB_TOKEN: '' | |
# At this point any scripts that exist in the filesystem _cannot_ be trusted | |
# But I think (...?) if we do everything in the workflow from here on, | |
# it should be safe and be unable to trash the live site. I think anyway... | |
# - name: Create Build Archive | |
# run: tar -c --lzma -f deployed.tar.gz ./Browser_IDE # ${{ inputs.pr-number }} | |
- name: Checkout Site Builds | |
uses: actions/checkout@v4 | |
with: | |
path: site-builds | |
ref: site-builds | |
- name: Upload Built Archive | |
working-directory: ./site-builds | |
run: | | |
git checkout --orphan new-site-builds site-builds | |
# delete everything except for pr-builds and .git, a bit hacky really... | |
mkdir -p ./pr-builds | |
mv ./pr-builds ../ | |
mv ./.git ../ | |
rm -r ./* | |
mv ../.git ./.git | |
mv ../pr-builds ./pr-builds | |
# move the new build in! | |
mv ../splashkitonline/Browser_IDE/* ./ | |
# commit! | |
git config --global user.email "buildbot@bot.bot" | |
git config --global user.name "build-bot-bob" | |
git add --all | |
git commit -m "Update builds" | |
git branch -M new-site-builds site-builds | |
git push origin site-builds --force-with-lease |