diff --git a/.github/workflows/build-webgl.yml b/.github/workflows/build-webgl.yml index 41a36b5c..1fcf79d6 100644 --- a/.github/workflows/build-webgl.yml +++ b/.github/workflows/build-webgl.yml @@ -5,11 +5,13 @@ name: AIS Prototype Build # way of doing this. on: push: + delete: workflow_dispatch: jobs: build: name: Build Unity Project + if: github.event_name != 'delete' runs-on: ubuntu-latest concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -88,7 +90,7 @@ jobs: - name: Upload build as artifact uses: actions/upload-artifact@v4 with: - name: ${{ github.event.repository.name }}-webgl_${{ env.VERSION }} + name: ${{ github.event.repository.name }}-webgl-${{ github.sha }} path: build/WebGL/WebGL/ overwrite: true @@ -101,4 +103,27 @@ jobs: remote_host: ${{ secrets.FIELDDAY_WISC_EDU_DEPLOY_HOST }} remote_user: ${{ secrets.FIELDDAY_WISC_EDU_DEPLOY_USER }} remote_key: ${{ secrets.FIELDDAY_WISC_EDU_DEPLOY_KEY }} - \ No newline at end of file + + # Vault staging CDN preview of the same build, alongside the DoIT deploy above until DoIT is retired: + # https://cdn.vaultlearninggames-staging.org/fielddaylab/ais-prototype// + # Runs even if the DoIT upload fails; needs only the build artifact. + preview: + needs: build + if: ${{ !cancelled() && github.event_name != 'delete' }} + permissions: + contents: read + id-token: write + uses: fielddaylab/vault-publisher/.github/workflows/publish-preview.yml@v1 + with: + game: ais-prototype + artifact: ${{ github.event.repository.name }}-webgl-${{ github.sha }} + + # Deleting a branch removes its preview. + remove-preview: + if: github.event_name == 'delete' + permissions: + contents: read + id-token: write + uses: fielddaylab/vault-publisher/.github/workflows/publish-preview.yml@v1 + with: + game: ais-prototype