Feature/mb 19 newsletter #39
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: CI/CD Pipeline | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '**.js' | |
- '**.jsx' | |
- '**.ts' | |
- '**.tsx' | |
- '**.json' | |
- '**.md' | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm install | |
- name: Run lint | |
run: npm run lint | |
test: | |
runs-on: ubuntu-latest | |
needs: lint | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm install | |
- name: Run tests | |
run: npm test | |
build: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
env: | |
NEXT_PUBLIC_SANITY_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_SANITY_PROJECT_ID }} | |
NEXT_PUBLIC_SANITY_DATASET: ${{ secrets.NEXT_PUBLIC_SANITY_DATASET }} | |
run: npm run build | |
# deploy: | |
# runs-on: ubuntu-latest | |
# needs: build | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v4 | |
# - name: Setup Node.js | |
# uses: actions/setup-node@v4 | |
# with: | |
# node-version: '20' | |
# - name: Install dependencies | |
# run: npm install | |
# - name: Deploy | |
# env: | |
# VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} # Make sure to add your Vercel token in GitHub secrets | |
# NEXT_PUBLIC_SANITY_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_SANITY_PROJECT_ID }} | |
# NEXT_PUBLIC_SANITY_DATASET: ${{ secrets.NEXT_PUBLIC_SANITY_DATASET }} | |
# run: | | |
# # Add your deployment command here | |
# npx vercel --prod |