Skip to content

patch: update dependencies, improve setup configuration, and add Wind… #6

patch: update dependencies, improve setup configuration, and add Wind…

patch: update dependencies, improve setup configuration, and add Wind… #6

Workflow file for this run

name: Frontend CI/CD
on:
push:
branches: [ main, master ]
paths:
- 'networkmonitor/web/**'
pull_request:
branches: [ main, master ]
paths:
- 'networkmonitor/web/**'
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: networkmonitor/web
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: networkmonitor/web/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
deploy:
needs: test
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
steps:
- uses: actions/checkout@v4
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
working-directory: networkmonitor/web
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
working-directory: networkmonitor/web
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
working-directory: networkmonitor/web
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}