This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Firebase | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "18" | |
- name: Install dependencies | |
run: npm install | |
- name: Run build | |
env: | |
VITE_REACT_APP_FIREBASE_API_KEY: ${{ secrets.VITE_REACT_APP_FIREBASE_API_KEY }} | |
VITE_REACT_APP_FIREBASE_AUTH_DOMAIN: ${{ secrets.VITE_REACT_APP_FIREBASE_AUTH_DOMAIN }} | |
VITE_REACT_APP_FIREBASE_PROJECT_ID: ${{ secrets.VITE_REACT_APP_FIREBASE_PROJECT_ID }} | |
VITE_REACT_APP_FIREBASE_STORAGE_BUCKET: ${{ secrets.VITE_REACT_APP_FIREBASE_STORAGE_BUCKET }} | |
VITE_REACT_APP_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.VITE_REACT_APP_FIREBASE_MESSAGING_SENDER_ID }} | |
VITE_REACT_APP_FIREBASE_APP_ID: ${{ secrets.VITE_REACT_APP_FIREBASE_APP_ID }} | |
VITE_REACT_APP_FIREBASE_MEASUREMENT_ID: ${{ secrets.VITE_REACT_APP_FIREBASE_MEASUREMENT_ID }} | |
VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }} | |
VITE_SUPABASE_ANON_KEY: ${{ secrets.VITE_SUPABASE_ANON_KEY }} | |
run: npm run build | |
- name: Run tests | |
run: npm test | |
- name: Install firebase-tools | |
run: npm install --save-dev firebase-tools | |
- name: Deploy to Firebase | |
uses: w9jds/firebase-action@master | |
with: | |
args: deploy --only hosting | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} |