Skip to content

Deploy Frontend to GitHub Pages (Manual) #36

Deploy Frontend to GitHub Pages (Manual)

Deploy Frontend to GitHub Pages (Manual) #36

name: Deploy Frontend to GitHub Pages (Manual)
on:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages-deploy"
cancel-in-progress: true
env:
NODE_VERSION: '20'
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- name: Install dependencies
run: npm ci
- name: Build
env:
VITE_BACKEND_URL: ${{ secrets.VITE_BACKEND_URL }}
VITE_GA_MEASUREMENT_ID: ${{ secrets.VITE_GA_MEASUREMENT_ID }}
VITE_PUBLIC_POSTHOG_KEY: ${{ secrets.VITE_PUBLIC_POSTHOG_KEY }}
VITE_PUBLIC_POSTHOG_HOST: ${{ secrets.VITE_PUBLIC_POSTHOG_HOST }}
VITE_ANALYTICS_DISABLED: ${{ secrets.VITE_ANALYTICS_DISABLED }}
VITE_BASE_PATH: /LiftShift/
BASE_ASSETS: /LiftShift/
run: npm run build
- name: Configure Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
name: github-pages-${{ github.run_id }}-${{ github.run_attempt }}
path: dist/client
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: github-pages-${{ github.run_id }}-${{ github.run_attempt }}