Skip to content

OCT-12

OCT-12 #105

Workflow file for this run

name: PR Validation & Preview Deploy
on:
workflow_dispatch:
pull_request:
branches:
- "*"
- "!master" # excludes master
types: [opened, synchronize, reopened]
# Set the access for individual scopes, or use permissions: write-all
permissions:
pull-requests: write
contents: read
actions: read
deployments: write
env:
NODE_VERSION: 20
jobs:
lint:
if: github.actor != 'dependabot[bot]'
name: Validate Code
runs-on: ubuntu-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Check out Git repository
uses: actions/checkout@v4
- name: Cache node modules
uses: actions/cache@v4
id: cache-npm
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install Node.js dependencies
if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
run: |
npm install -g pnpm
pnpm install --frozen-lockfile
- name: Run Formatter Check
run: npm run prettier:check
- name: Run Link Check
run: npm run lint
preview:
needs: lint
name: Preview Deploy
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}}