Fix preview deploys on Netlify #3
This file contains 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
# Workflow for deploying to Netlify as Preview | |
name: Preview Deploy | |
on: | |
# Runs on pushes targeting the default branch | |
push: | |
branches: ["master"] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to Netlify | |
permissions: | |
contents: read | |
deployments: write | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: "netlify" | |
cancel-in-progress: false | |
jobs: | |
# Single deploy job since we're just deploying | |
deploy: | |
environment: | |
name: netlify | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v3 | |
with: | |
version: 8 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build artifact | |
run: | | |
pnpm run build | |
- name: Deploy to Netlify | |
uses: nwtgck/[email protected] | |
with: | |
alias: "preview" | |
publish-dir: './build' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
deploy-message: "Deploy from GitHub Actions" | |
enable-pull-request-comment: false | |
enable-commit-comment: true | |
enable-commit-status: true | |
overwrites-pull-request-comment: true | |
#netlify-config-path: ./netlify.toml | |
#functions-dir: ./netlify/edge-functions | |
github-deployment-environment: "netlify-preview" | |
github-deployment-description: "Preview Deployment on Netlify" | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} |