From e862a7e0664833d581780ae97c64469b5e2ba62c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Portas=20L=C3=B3pez?= <81629707+TeenBiscuits@users.noreply.github.com> Date: Fri, 16 Feb 2024 22:45:00 +0100 Subject: [PATCH] Digo yo que de esta va --- .github/workflows/godot-publish.yml | 71 +++++++++++++++-------------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/.github/workflows/godot-publish.yml b/.github/workflows/godot-publish.yml index 2b93eac..91ae0dd 100644 --- a/.github/workflows/godot-publish.yml +++ b/.github/workflows/godot-publish.yml @@ -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' \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: main # The branch the action should deploy to. + FOLDER: build/web # The folder the action should deploy.