center game according to viewport instead of OS #9
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
name: Build Game | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: build | |
cancel-in-progress: true | |
jobs: | |
godot-builder: | |
name: Build Godot Builder Dockerfile | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
filters: | | |
builder: | |
- 'godot-build.dockerfile' | |
- name: Set up Docker Buildx | |
if: steps.changes.outputs.builder == 'true' | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
if: steps.changes.outputs.builder == 'true' | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and Push | |
if: steps.changes.outputs.builder == 'true' | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
file: godot-build.dockerfile | |
tags: ghcr.io/smartive/godot-dotnet-builder:8.0-3.5.3 | |
build-args: | | |
COMMIT_SHA=${{ github.sha }} | |
build-html: | |
name: Build HTML5 | |
runs-on: ubuntu-latest | |
needs: godot-builder | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Export to HTML | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: ghcr.io/smartive/godot-dotnet-builder:8.0-3.5.3 | |
options: -v ${{ github.workspace }}:/game | |
run: | | |
cd /game | |
mkdir -p build | |
godot -v --export "HTML5" build/index.html | |
- name: Change permissions | |
run: sudo chown -R $(whoami) build | |
- name: Cache Busting | |
run: | | |
TS=$(date +%s) | |
for f in index.*; do | |
mv $f ${f/./.$TS.} | |
done | |
sed "s/index/index.${TS}/g" index.$TS.html > index.html | |
working-directory: ./build | |
- uses: actions/upload-pages-artifact@v1 | |
with: | |
path: build | |
- uses: actions/deploy-pages@v1 |