diff --git a/.github/workflows/bun_build_and_deploy.yml b/.github/workflows/bun_build_and_deploy.yml index 86f1918..dc7e2b8 100644 --- a/.github/workflows/bun_build_and_deploy.yml +++ b/.github/workflows/bun_build_and_deploy.yml @@ -1,14 +1,14 @@ -name: Bun Build and Deploy to GitHub Pages +name: Test, then Build/Deploy to GitHub Pages on: push: branches: - main + pull_request: jobs: - build: + test: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v2 @@ -20,16 +20,13 @@ jobs: - name: Install Dependencies run: bun install - - name: Run Build - run: bun run build-site + - name: Run Tests + run: bun test - - name: Upload Artifacts - uses: actions/upload-pages-artifact@v1 - with: - path: ./build - - deploy: - needs: build + build_and_deploy: + if: > + github.event_name == 'push' && github.ref == 'refs/heads/main' + needs: test runs-on: ubuntu-latest environment: name: github-pages @@ -38,5 +35,23 @@ jobs: id-token: write steps: + - uses: actions/checkout@v2 + + - name: Setup Bun + uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + + - name: Install Dependencies + run: bun install + + - name: Run Build + run: bun run build-site + + - name: Upload Artifacts + uses: actions/upload-pages-artifact@v1 + with: + path: ./build + - name: Deploy to GitHub Pages uses: actions/deploy-pages@v2