69 lines
No EOL
2 KiB
YAML
69 lines
No EOL
2 KiB
YAML
name: Build and Deploy Godot HTML5
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: docker
|
|
|
|
steps:
|
|
# ---------------------------
|
|
# 1. Checkout repository
|
|
# ---------------------------
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v4
|
|
|
|
# ---------------------------
|
|
# 2. Install dependencies
|
|
# ---------------------------
|
|
- name: Install tools
|
|
run: |
|
|
apt update
|
|
apt install -y wget unzip rsync
|
|
|
|
# ---------------------------
|
|
# 3. Install Godot (headless CLI)
|
|
# ---------------------------
|
|
- name: Install Godot
|
|
run: |
|
|
wget https://github.com/godotengine/godot/releases/download/4.6-stable/Godot_v4.6-stable_linux.x86_64.zip
|
|
unzip Godot_v4.6-stable_linux.x86_64.zip
|
|
chmod +x Godot_v4.6-stable_linux.x86_64
|
|
mv Godot_v4.6-stable_linux.x86_64 /usr/local/bin/godot
|
|
|
|
# ---------------------------
|
|
# 4. Verify Godot is available
|
|
# ---------------------------
|
|
- name: Verify Godot
|
|
run: godot --version
|
|
|
|
- name: Install export templates
|
|
run: |
|
|
VERSION=4.2
|
|
|
|
mkdir -p ~/.local/share/godot/export_templates/${VERSION}.stable
|
|
|
|
wget -O templates.tpz \
|
|
https://github.com/godotengine/godot/releases/download/${VERSION}-stable/Godot_v${VERSION}-stable_export_templates.tpz
|
|
|
|
unzip templates.tpz -d templates_tmp
|
|
|
|
cp -r templates_tmp/templates/* ~/.local/share/godot/export_templates/${VERSION}.stable/
|
|
|
|
# ---------------------------
|
|
# 5. Build HTML5 export
|
|
# ---------------------------
|
|
- name: Build HTML5
|
|
run: |
|
|
mkdir -p build/html5
|
|
godot --headless --export-release "Web" build/html5/index.html
|
|
|
|
# ---------------------------
|
|
# 6. Deploy to Nginx folder
|
|
# ---------------------------
|
|
- name: Deploy to server folder
|
|
run: |
|
|
rsync -av --delete build/html5/ /deploy/TheFlipSide |