Skip to content

CI

CI #4270

Workflow file for this run

name: CI
'on':
push:
schedule:
- cron: "0 7 * * *"
jobs:
test:
name: Lint & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: '${{ runner.os }}-node-${{ hashFiles(''**/package-lock.json'') }}'
- name: Install dependencies
run: npm ci && cd functions && npm ci && cd ..
- name: Lint
run: npm run lint
- name: Test
run: npm run test
deployFrontend:
name: Deploy Frontend
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: '${{ runner.os }}-node-${{ hashFiles(''**/package-lock.json'') }}'
- name: Install dependencies
run: npm ci && cd functions && npm ci && cd ..
- name: Build Project for Production
run: npm run build
env:
BASE: '/'
BASE_URL: 'https://adrianjost.dev'
- name: Deploy to Firebase
run: npx -p firebase-tools firebase deploy --only hosting --token $FIREBASE_TOKEN
env:
FIREBASE_TOKEN: '${{ secrets.FIREBASE_TOKEN }}'
deployBackend:
name: Deploy Backend
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: '${{ runner.os }}-node-${{ hashFiles(''**/package-lock.json'') }}'
- name: Install dependencies
run: npm ci && cd functions && npm ci && cd ..
- name: Deploy to Firebase
run: npx -p firebase-tools firebase deploy --only functions --token $FIREBASE_TOKEN
env:
FIREBASE_TOKEN: '${{ secrets.FIREBASE_TOKEN }}'