Skip to content

Deploy Frontend to Github Pages #12

Deploy Frontend to Github Pages

Deploy Frontend to Github Pages #12

Workflow file for this run

name: Deploy Frontend to Github Pages
on:
workflow_run:
workflows: ["Unit And E2E Tests"]
types:
- completed
# push:
# branches: [ main ]
env:
VITE_API_URL: https://fullstack-task-app.onrender.com
jobs:
deploy-frontend:
if: ${{ github.event.workflow_run.conclusion == 'success' }} # ✅ only if CI succeeded
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Build frontend
run: npm run build
- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.TOKEN }}
publish_dir: frontend/dist