Deploy test #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .github/workflows/preview.yml | |
| name: PR Preview | |
| on: | |
| pull_request: | |
| branches: [main] | |
| # Permissions required by the Pages preview deployment | |
| permissions: | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pr-preview-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Use Node 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install | |
| run: npm ci | |
| - name: Lint / Types / Tests | |
| run: | | |
| npm run lint | |
| npm run type-check | |
| npm test | |
| # Build the site the same way your deploy script would build it | |
| - name: Build | |
| run: npm run build | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: dist | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages (preview) | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |