Skip to content

Update test-and-deploy.yml #4

Update test-and-deploy.yml

Update test-and-deploy.yml #4

Workflow file for this run

name: Deploy to Netlify
on:
pull_request:
branches:
- main
push:
branches-ignore:
- main
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
- name: Run tests
run: pnpm test
build:
name: Build and Deploy to Netlify
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
- name: Build site
run: pnpm build
- name: Deploy to Netlify
uses: jsmrcaga/action-netlify-deploy@master
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
with:
args: deploy --prod --dir ./site/build