Skip to content

Instantly share code, notes, and snippets.

@bsommardahl
Created March 16, 2022 15:20
Show Gist options
  • Save bsommardahl/526336630e00259a21d482c587359444 to your computer and use it in GitHub Desktop.
Save bsommardahl/526336630e00259a21d482c587359444 to your computer and use it in GitHub Desktop.
Hapi Backend, Github Actions, Firebase functions
{
"projects": {
"default": "codex-academy-backend"
}
}
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools
name: Deploy to Firebase Functions on merge
'on':
push:
branches:
- main
- byron-test
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2
with:
node-version: '16'
- uses: actions/checkout@v2
- name: Setup Prisma/Database
run: |
npm i -g prisma
npm run generate
env:
DATABASE_URL: ${{secrets.DATABASE_URL_PROD}}
- name: Build Code
run: npm ci && npm run build
- name: Deploy server to Firebase Functions
uses: jsryudev/deploy-firebase-functions@v0.0.2
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN_PROD }}
FIREBASE_PROJECT: codex-academy-backend
{
"functions": {
"runtime": "nodejs16",
"predeploy": [
"npm run build"
],
"source":"."
}
}
{
"name": "backend",
"version": "1.0.0",
"description": "",
"main": "dist/index.js",
"engines": {
"node": "16"
},
"scripts": {
"generate": "npx prisma db pull && npx prisma generate",
"prestart": "npm run build",
"start": "node dist/server.js",
"build": "tsc",
"test": "jest",
"dev:tsc": "tsc --watch -p .",
"dev:serve": "nodemon --exec ./node_modules/.bin/ts-node -- ./src/server.ts",
"dev": "run-p dev:*",
"lint": "eslint --ext .js,.ts .",
"serve": "npm run build && firebase emulators:start --only functions",
"firebase_shell": "npm run build && firebase functions:shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"repository": {
"type": "git",
"url": "git+https://github.com/CodeX-Academy-Official/backend.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/CodeX-Academy-Official/backend/issues"
},
"homepage": "https://github.com/CodeX-Academy-Official/backend#readme",
"devDependencies": {
"@types/jest": "^27.4.1",
"@typescript-eslint/eslint-plugin": "^5.12.0",
"@typescript-eslint/parser": "^5.12.0",
"eslint": "^8.9.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-import": "^2.25.4",
"firebase-functions-test": "^0.2.0",
"jest": "^27.5.1",
"nodemon": "^2.0.15",
"npm-run-all": "^4.1.5",
"ts-jest": "^27.1.3",
"ts-node": "^10.5.0",
"typescript": "^4.5.5"
},
"dependencies": {
"@hapi/boom": "^9.1.4",
"@hapi/hapi": "^20.2.1",
"@hapi/podium": "^4.1.3",
"@prisma/client": "^3.10.0",
"@slack/web-api": "^6.6.0",
"@types/hapi__hapi": "^20.0.10",
"@types/node": "^17.0.21",
"axios": "^0.26.0",
"dotenv": "^16.0.0",
"firebase-admin": "^10.0.2",
"firebase-functions": "^3.18.0",
"hapi-error": "^2.3.0",
"joi": "^17.6.0",
"moment": "^2.29.1",
"prisma": "^3.10.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment