Format the codebase #27
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
# https://github.com/abarichello/godot-ci | |
# https://github.com/abarichello/godot-ci/issues/123 | |
# https://github.com/abarichello/godot-ci/pull/113 | |
# | |
# Thanks to MikulasZelinka for making this file! | |
name: Godot Export | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "README.md" | |
- ".gitattributes" | |
- ".gitignore" | |
env: | |
GODOT_VERSION: 4.2.1 | |
jobs: | |
export-web: | |
name: Web Export | |
runs-on: ubuntu-20.04 | |
container: | |
# TODO: how to interpolate the env var here? | |
# image: barichello/godot-ci:${GODOT_VERSION} | |
image: barichello/godot-ci:4.2.1 | |
steps: | |
- name: 🛎️ Checkout | |
uses: actions/checkout@v4 | |
# with: | |
# lfs: true | |
- name: 🏹 Setup | |
run: | | |
mkdir -v -p ~/.local/share/godot/export_templates | |
mv /root/.local/share/godot/templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable | |
cd ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable | |
ls -l | |
- name: 🔧 Web Build | |
run: | | |
mkdir -v -p build/web | |
godot --headless --verbose --export-release "Web" ./build/web/index.html | |
ls -lah build/web | |
- name: 🤕 Netlify headers | |
# https://github.com/godotengine/godot/issues/69020 | |
# https://github.com/godotengine/godot/blob/master/platform/web/serve.py | |
# https://docs.netlify.com/routing/headers/ | |
run: | | |
cat <<EOF > build/web/_headers | |
/* | |
Cross-Origin-Opener-Policy: same-origin | |
Cross-Origin-Embedder-Policy: require-corp | |
Access-Control-Allow-Origin: * | |
EOF | |
cat build/web/_headers | |
- name: 🚀 Deploy to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@v4.4.3 | |
with: | |
folder: build/web |