diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6389839..cb5bb1a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,6 +16,7 @@ concurrency: cancel-in-progress: false jobs: build: + if: github.ref != 'refs/heads/gh-pages' strategy: matrix: game: [bubbo-bubbo, puzzling-potions] @@ -23,23 +24,36 @@ jobs: with: game: ${{ matrix.game }} deploy: - if: github.ref_name == 'main' + if: github.ref != 'refs/heads/gh-pages' needs: build - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: + - name: Checkout gh-pages branch + uses: actions/checkout@v3 + with: + ref: gh-pages + fetch-depth: 0 + token: ${{ secrets.PAT }} + - name: Create branch directory + run: mkdir -p ${{github.ref_name}} - name: Download Artifacts uses: actions/download-artifact@v4 + with: + path: ${{ github.ref_name }} + - name: Display structure of downloaded files + run: ls -R + working-directory: ${{ github.ref_name }} - name: Setup Pages uses: actions/configure-pages@v4 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - # Upload entire repository - path: '.' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + + - name: Commit and push changes + run: | + git config user.name github-actions + git config user.email github-actions@github.com + git add . + git commit -m "Update deployment for ${{ github.ref_name }}" + git push https://${{ secrets.PAT }}@github.com/${{ github.repository }}.git HEAD:gh-pages + environment: + name: github-pages + url: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ github.ref_name }} diff --git a/README.md b/README.md index dbcc1a2..536e969 100644 --- a/README.md +++ b/README.md @@ -29,3 +29,4 @@ Below is a list of tools that are used in the games. These tools are also open s - [PixiJS Spine](https://github.com/pixijs/spine) Spine animation support for PixiJS For more plugins and tools, check out the PixiJS Organization on GitHub: https://github.com/pixijs + diff --git a/bubbo-bubbo/src/assets.ts b/bubbo-bubbo/src/assets.ts index e1ab279..b45ff09 100644 --- a/bubbo-bubbo/src/assets.ts +++ b/bubbo-bubbo/src/assets.ts @@ -21,7 +21,7 @@ extensions.add(resolveJsonUrl); /** Initialise and start background loading of all assets */ export async function initAssets() { // Init PixiJS assets with this asset manifest - await Assets.init({ manifest, basePath: 'assets'}); + await Assets.init({ manifest, basePath: 'assets' }); // Load assets for the load screen await Assets.loadBundle(['preload', 'default']);