diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index efb83c5..c88aa26 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -1,11 +1,12 @@ -# Workflow for deploying static content to GitHub Pages -name: Deploy scanner-ui to GitHub Pages +name: GitHub Pages on: - # Runs on pushes targeting the default branch push: - branches: ["main"] - # Allows you to run this workflow manually from the Actions tab + branches: + - main + pull_request: + branches: + - main workflow_dispatch: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages @@ -22,17 +23,12 @@ concurrency: cancel-in-progress: false jobs: - # Single deploy job since we're just deploying - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} + build: + name: Build runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - - name: Setup Pages - uses: actions/configure-pages@v5 - uses: pnpm/action-setup@v4 with: version: 9 @@ -46,11 +42,26 @@ jobs: run: pnpm install - name: Build app run: pnpm run build - - name: Upload artifact + + - name: Setup Pages + if: github.ref == 'refs/heads/main' + uses: actions/configure-pages@v5 + + - name: Upload Artifact + if: github.ref == 'refs/heads/main' uses: actions/upload-pages-artifact@v3 with: # Upload entire repository path: './dist' + + deploy: + if: github.ref == 'refs/heads/main' + needs: build + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4