forked from GDQuest/learn-gdscript
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (54 loc) · 1.84 KB
/
BuildGodot.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: "Godot->GHPages"
on:
push:
branches: [release]
workflow_dispatch:
env:
GODOT_VERSION: 3.4.1
jobs:
export-web:
name: Web Export
runs-on: ubuntu-latest
container:
image: barichello/godot-ci:3.4.1
steps:
- name: Checkout
uses: actions/checkout@v2
with:
lfs: true
- name: Setup
run: |
mkdir -v -p ~/.local/share/godot/templates
mv /root/.local/share/godot/templates/${GODOT_VERSION}.stable ~/.local/share/godot/templates/${GODOT_VERSION}.stable
- name: Install Necessary Software
run: |
apt-get update && apt-get install -y --no-install-recommends sed
- name: Web Build
run: |
mkdir -v -p build/web && \
godot -v --export "HTML5" build/web/index.html || true && \
echo "built godot"
- name: Copy static files
run: |
cp -r html_export/static/* build/web && \
echo "copied files"
- name: Add Git Hash to build
run: |
cd build/web
sed -i "s@>branch and commit hash<@>$GITHUB_REF:$GITHUB_SHA<@" index.html && \
echo "added commit hash to index.html" || echo "failed to add the commit hash"
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: web
path: build/web
# Installing rsync is needed in order to deploy to GitHub Pages. Without it, the build will fail.
- name: Install rsync 📚
run: |
apt-get update && apt-get install -y rsync
- name: Deploy to GitHub Pages 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: build/web # The folder the action should deploy.