DNS record is now managed by infra config #77
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
| name: Deploy Preview | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '22' | |
| - name: Install and export | |
| run: | | |
| npm install | |
| npm run export | |
| env: | |
| WEBSITE_BASE_PATH: "/previews/pr-${{ github.event.pull_request.number }}" | |
| - name: Deploy to GitHub Pages Preview | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| branch: gh-pages | |
| folder: ./out | |
| target-folder: previews/pr-${{ github.event.pull_request.number }} | |
| clean: false # <-- DO NOT clean the whole branch | |
| force: false # <-- DO NOT force overwrite | |
| - name: Comment on the PR with the preview link | |
| uses: peter-evans/create-or-update-comment@v3 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| issue-number: ${{ github.event.pull_request.number }} | |
| body: | | |
| 🚀 Preview of the changes is available at: | |
| https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/previews/pr-${{ github.event.pull_request.number }} | |
| edit-mode: replace |