8484 # <https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-storage-and-bandwidth-usage>
8585 git_lfs : false
8686
87- # Enabling this only helps with consecutive releases to the same version (and takes up cache storage space).
88- # See: <https://github.com/orgs/community/discussions/27059>.
89- # This is most useful in combination with `continuous_deployment_to_itch`
90- use_github_cache : true
91-
92- # Whether to deploy the newest version of the app on every push to `main` to itch.io. Requires `itch_page` to be set.
87+ # Whether to deploy the newest version of the app on every push to `main` to web targets.
88+ # Will upload to GitHub pages and / or to itch.io if they have been configured.
9389 # Will ignore warnings.
94- continuous_deployment_to_itch : true
90+ # Warning: If you use private repositories, this will eat through your available worker minutes quickly.
91+ continuous_deployment_to_web : true
9592
9693 # Need to use nightly for stutterless audio on Wasm. For simplicity, use the same toolchain across all build targets
9794 toolchain : nightly-2026-01-22
@@ -107,7 +104,7 @@ jobs:
107104 run : " true"
108105 outputs :
109106 itch_page : ${{ env.itch_page }}
110- continuous_deployment_to_itch : ${{ env.continuous_deployment_to_itch }}
107+ continuous_deployment_to_web : ${{ env.continuous_deployment_to_web }}
111108
112109 # Determine the version number for this workflow.
113110 get-version :
@@ -174,6 +171,7 @@ jobs:
174171 needs :
175172 - get-version
176173 - bake-assets
174+ - forward-env
177175 env :
178176 version : ${{ needs.get-version.outputs.version }}
179177 # Avoid rate-limiting. See: <https://github.com/cargo-bins/cargo-binstall/issues/2045>.
@@ -232,7 +230,7 @@ jobs:
232230
233231 # Check if building for this platform is enabled.
234232 echo 'is_platform_enabled=${{
235- (matrix.platform == 'web' && (inputs.build_for_web || (github.event_name == 'push' && env.continuous_deployment_to_itch == 'true'))) ||
233+ (matrix.platform == 'web' && (inputs.build_for_web || (github.event_name == 'push' && env.continuous_deployment_to_web == 'true'))) ||
236234 (matrix.platform == 'linux' && inputs.build_for_linux) ||
237235 (matrix.platform == 'windows' && inputs.build_for_windows) ||
238236 (matrix.platform == 'macos' && inputs.build_for_macos)
@@ -264,7 +262,7 @@ jobs:
264262 toolchain : ${{ env.toolchain }}
265263
266264 - name : Restore Rust cache
267- if : ${{ env.is_platform_enabled == 'true' && env.use_github_cache == 'true' }}
265+ if : ${{ env.is_platform_enabled == 'true' && needs.forward- env.outputs.continuous_deployment_to_web == 'true' }}
268266 uses : Swatinem/rust-cache@v2
269267 with :
270268 shared-key : release
@@ -375,7 +373,7 @@ jobs:
375373 retention-days : 1
376374
377375 - name : Upload web bundle to workflow artifacts for GitHub Pages (Web)
378- if : ${{ env.is_platform_enabled == 'true' && matrix.platform == 'web' && inputs.deploy_to_github_pages }}
376+ if : ${{ env.is_platform_enabled == 'true' && matrix.platform == 'web' && ( inputs.deploy_to_github_pages == 'true' || (github.event_name == 'push' && needs.forward-env.outputs.continuous_deployment_to_web== 'true')) }}
379377 uses : actions/upload-pages-artifact@v3
380378 with :
381379 path : ${{ env.app }}/${{ env.cargo_build_binary_name }}
@@ -394,11 +392,8 @@ jobs:
394392 # Deploy to itch.io.
395393 deploy-to-itch :
396394 runs-on : ubuntu-latest
397- needs :
398- - forward-env
399- - get-version
400- - build
401- if : ${{ (inputs.deploy_to_itch || (github.event_name == 'push' && needs.forward-env.outputs.continuous_deployment_to_itch == 'true')) && needs.forward-env.outputs.itch_page != '' }}
395+ needs : build
396+ if : ${{ (inputs.deploy_to_itch || (github.event_name == 'push' && needs.forward-env.outputs.continuous_deployment_to_web == 'true')) && needs.forward-env.outputs.itch_page != '' }}
402397
403398 steps :
404399 - name : Download packages
@@ -425,23 +420,3 @@ jobs:
425420 tmp/"${package}"/* \
426421 '${{ env.itch_page }}':"${package#package-}"
427422 done
428-
429- # Deploy to GitHub Pages.
430- deploy-to-github-pages :
431- runs-on : ubuntu-latest
432- needs : build
433- permissions :
434- # Required to deploy to GitHub Pages.
435- pages : write
436- # Required for GitHub Pages to verify the source of the deployment.
437- # See: <https://github.com/actions/deploy-pages/issues/329>.
438- id-token : write
439- environment :
440- name : github-pages
441- url : ${{ steps.deploy.outputs.page_url }}
442- if : ${{ inputs.deploy_to_github_pages && inputs.build_for_web }}
443-
444- steps :
445- - name : Deploy to GitHub Pages
446- id : deploy
447- uses : actions/deploy-pages@v4
0 commit comments