Skip to content

πŸš€ Create netlify-cd.yaml #3

πŸš€ Create netlify-cd.yaml

πŸš€ Create netlify-cd.yaml #3

Workflow file for this run

name: Deploy to Netlify
on:
# Runs on pushes targeting the default branch
push:
branches:
- "master"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allow one concurrent deployment
concurrency:
group: "netlify"
cancel-in-progress: true
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: Netlify
url: ${{ steps.netlify_deploy.outputs.NETLIFY_LIVE_URL }}
runs-on: ubuntu-latest
steps:
- name: Checkout master branch
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Deploy to Netlify
uses: netlify/actions/cli@master
with:
args: deploy --prod
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
id: netlify_deploy