Skip to content

Vapi hackathon frontend #7

Vapi hackathon frontend

Vapi hackathon frontend #7

name: Deploy Frontend VAPI to GitHub Pages
on:
push:
branches: [main]
paths:
- "frontend_vapi/**"
pull_request:
branches: [main]
paths:
- "frontend_vapi/**"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "pnpm"
cache-dependency-path: frontend_vapi/pnpm-lock.yaml
- name: Setup Pages
uses: actions/configure-pages@v4
with:
static_site_generator: next
enablement: true
- name: Install dependencies
run: pnpm install
working-directory: ./frontend_vapi
- name: Create .env.local file
run: |
echo "NEXT_PUBLIC_VAPI_KEY=${{ secrets.NEXT_PUBLIC_VAPI_KEY }}" >> .env.local
echo "NEXT_PUBLIC_PRIVY_APP_ID=${{ secrets.NEXT_PUBLIC_PRIVY_APP_ID }}" >> .env.local
echo "NEXT_PUBLIC_OTO_API_ENDPOINT=${{ secrets.NEXT_PUBLIC_OTO_API_ENDPOINT }}" >> .env.local
echo "NEXT_PUBLIC_OTO_API_KEY=${{ secrets.NEXT_PUBLIC_OTO_API_KEY }}" >> .env.local
working-directory: ./frontend_vapi
- name: Build with Next.js
run: pnpm build
working-directory: ./frontend_vapi
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./frontend_vapi/out
deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4