Skip to content

Commit

Permalink
Use nix in github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
yunusey committed Jan 14, 2025
1 parent c488acc commit 76dc7d8
Showing 1 changed file with 48 additions and 27 deletions.
75 changes: 48 additions & 27 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ on:
- ".gitattributes"
- ".gitignore"

env:
GODOT_VERSION: 4.3

jobs:
export-web:
name: Web Export
build-wasm:
name: Build WASM
runs-on: ubuntu-20.04
steps:
- name: Checkout
Expand All @@ -25,28 +28,46 @@ jobs:
with:
name: godot-neural-networks-wasm
path: ./rust/godot-neural-networks/target/wasm32-unknown-emscripten/release/godot_neural_networks.wasm

# - name: Web Build
# run: |
# mkdir -v -p build/web
# godot --headless --verbose --export-release "Web" ../exports/
# 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 artifacts to `artifacts` branch
# uses: s0/git-publish-subdir-action@develop
# env:
# REPO: self
# BRANCH: gh-pages
# FOLDER: ./build/web
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
export-web:
name: Web Export
runs-on: ubuntu-20.04
container:
image: barichello/godot-ci:4.3
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
- name: 🔧 Generate folders
run: |
mkdir -v -p ./game/extern/release
- name: 📦 Download artifacts
uses: actions/download-artifact@v3
with:
name: godot-neural-networks-wasm
path: ./game/extern/release
- 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
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 artifacts to `artifacts` branch
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: gh-pages
FOLDER: ./build/web
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 76dc7d8

Please sign in to comment.