-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
83d7e2b
commit e862a7e
Showing
1 changed file
with
37 additions
and
34 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,53 @@ | ||
# Workflow to publish Godot HTML5 games to GitHub Pages | ||
# | ||
# This script assumes that the project itself is in a subdirectory "project". This | ||
# folder structure frees up the root of the repository to be used for non-project | ||
# files, such as the README, build folder, or raw assets folder. | ||
# | ||
# Make sure your project is configured for Web export | ||
# to the path `build/web`. | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: 'Publish to GitHub Pages' | ||
name: CI | ||
|
||
env: | ||
GODOT_VERSION: 4.2.1 # Remember to manually set image to this version below. | ||
|
||
GODOT_VERSION: 4.2.1 | ||
|
||
# Controls when the workflow will run | ||
on: | ||
workflow_dispatch: | ||
# Triggers the workflow on push or pull request events but only for the main branch | ||
push: | ||
branches: | ||
- main | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-18.04 | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
export-web: | ||
name: Web Export | ||
runs-on: ubuntu-latest | ||
container: | ||
image: barichello/godot-ci:4.2.1 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Move HTML5 templates into position | ||
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: Create staging directory | ||
run: mkdir -v -p build/web | ||
|
||
- name: Build | ||
run: godot -v --export "HTML5" ../build/web/index.html project/project.godot | ||
|
||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
- name: Web Build | ||
run: | | ||
mkdir -v -p build/web | ||
godot -v --export "HTML5" ./build/web/index.html | ||
- 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 }} | ||
publish_dir: ./build/web | ||
force_orphan: true | ||
user_name: 'github-ci[bot]' | ||
user_email: 'github-actions[bot]@users.noreply.github.com' | ||
commit_message: 'Publish to gh-pages' | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: main # The branch the action should deploy to. | ||
FOLDER: build/web # The folder the action should deploy. |