Skip to content

Merge pull request #57 from IT2810-H26/feat/real-map #10

Merge pull request #57 from IT2810-H26/feat/real-map

Merge pull request #57 from IT2810-H26/feat/real-map #10

Workflow file for this run

name: Validate and deploy frontend
on:
push:
branches:
- main
permissions:
contents: read
concurrency:
group: project2-frontend-production
cancel-in-progress: false
jobs:
validate-and-deploy:
name: Validate and deploy main
if: github.ref == 'refs/heads/main'
runs-on: [self-hosted, linux, x64, t07-project-2]
timeout-minutes: 20
defaults:
run:
working-directory: client
steps:
- name: Check out main commit
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: client/package-lock.json
- name: Install dependencies
run: npm ci
- name: Check formatting
run: npm run format:check
- name: Run Oxlint
run: npm run lint
- name: Run tests
run: npm run test
- name: Build frontend
run: npm run build
- name: Deploy verified main
working-directory: .
run: sudo -n /usr/bin/systemctl start t07-project2-deploy.service
- name: Verify deployed commit
working-directory: .
run: test "$(cat /var/www/t07-project2/current/.commit)" = "$GITHUB_SHA"