Skip to content

Commit

Permalink
Update firebase-hosting-merge.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
burnt-exe authored Jun 2, 2024
1 parent ba760f1 commit 86486fc
Showing 1 changed file with 43 additions and 8 deletions.
51 changes: 43 additions & 8 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,55 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools
name: Build and Deploy

name: Deploy to Firebase Hosting on merge
on:
push:
branches:
- main

jobs:
build_and_deploy:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Create package.json if it doesn't exist
run: |
if [ ! -f package.json ]; then
echo '{
"name": "madj101",
"version": "1.0.0",
"description": "Mobile App Development for Juniors",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Raydo Matthee",
"license": "ISC",
"dependencies": {}
}' > package.json
fi
- name: Install dependencies
run: |
if [ -f package-lock.json ]; then
npm ci
else
npm install
fi
- name: Build project
run: npm run build

- name: Deploy to Firebase Hosting
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_COURSE_MADJ101 }}
channelId: live
projectId: course-madj101
channelId: live

0 comments on commit 86486fc

Please sign in to comment.