diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index 62daf91..ced847d 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -3,6 +3,7 @@ name: Deploy Webapp to GitHub Pages on: push: branches: [main] + pull_request: workflow_dispatch: permissions: {} @@ -12,12 +13,10 @@ concurrency: cancel-in-progress: true jobs: - build-and-deploy: - name: Build and Deploy + build: + name: Build runs-on: ubuntu-latest permissions: - pages: write # needed for pages - id-token: write # needed for pages contents: read steps: - name: Checkout @@ -36,13 +35,26 @@ jobs: - name: Build webapp run: bun run build-html - - name: Configure Pages - uses: actions/configure-pages@v6 - - name: Upload artifact for Pages uses: actions/upload-pages-artifact@v5 with: path: out + deploy: + name: Deploy + needs: build + if: github.event_name == 'push' + runs-on: ubuntu-latest + permissions: + pages: write # needed for pages + id-token: write # needed for pages + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Configure Pages + uses: actions/configure-pages@v6 + - name: Deploy to GitHub Pages + id: deployment uses: actions/deploy-pages@v5