Skip to content

Merge pull request #13 from get-amigo/staging #2

Merge pull request #13 from get-amigo/staging

Merge pull request #13 from get-amigo/staging #2

name: Deploy to Vercel
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set Vercel Environment Variables
run: |
echo "VERCEL_ORG_ID=${{ secrets.VERCEL_ORG_ID }}" >> $GITHUB_ENV
echo "VERCEL_PROJECT_ID=${{ secrets.VERCEL_PRODUCTION_PROJECT_ID }}" >> $GITHUB_ENV
- name: Install dependencies
run: npm install
- name: Create .env file
run: |
echo "JWT_SECRET=${{ secrets.PRODUCTION_JWT_SECRET }}" >> .env
echo "DATABASE_URL=${{ secrets.PRODUCTION_DATABASE_URL }}" >> .env
echo "FIREBASE_WEB_API_KEY=${{ secrets.FIREBASE_WEB_API_KEY }}" >> .env
echo "ACCESS_CODE_EXPIRY=1y" >> .env
echo "ENV=production" >> .env
- name: Build project
run: npm run build
- name: Install Vercel CLI
run: npm i -g vercel@latest
- name: Deploy to Vercel
run: vercel --token ${{ secrets.VERCEL_TOKEN }} --prod