Add netlify auto deploy #1
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: Deploy to Netlify | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "frontend/**" # Only trigger when files in the frontend folder are changed | |
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" | |
cache: "yarn" | |
- name: Install dependencies and build | |
working-directory: frontend | |
run: | | |
yarn install | |
yarn build | |
- name: Deploy to Netlify | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
run: | | |
npm install -g netlify-cli | |
netlify deploy --prod --dir=frontend/dist --site=$NETLIFY_SITE_ID |