Add netlify config file #7
Workflow file for this run
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
name: Netlify Preview Deploy | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
paths: | |
- 'frontend/**' | |
jobs: | |
deploy-preview: | |
if: github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: write | |
deployments: write | |
defaults: | |
run: | |
working-directory: frontend | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
cache-dependency-path: frontend/package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Debug Environment | |
run: | | |
echo "Working directory: $(pwd)" | |
echo "Listing build directory:" | |
ls -la build/ | |
echo "Checking secret lengths:" | |
echo "NETLIFY_SITE_ID length: ${#NETLIFY_SITE_ID}" | |
echo "NETLIFY_AUTH_TOKEN length: ${#NETLIFY_AUTH_TOKEN}" | |
env: | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
- name: Deploy to Netlify | |
uses: nwtgck/actions-netlify@v2.1 | |
with: | |
publish-dir: 'build' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
deploy-message: "Deploy Preview for PR #${{ github.event.pull_request.number }}" | |
enable-pull-request-comment: true | |
enable-commit-comment: false | |
overwrites-pull-request-comment: true | |
alias: "deploy-preview-${{ github.event.pull_request.number }}" | |
production-deploy: false | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
timeout-minutes: 5 |