Skip to content

Commit

Permalink
Merge pull request #3 from gdsc-ssu/feat/firebase
Browse files Browse the repository at this point in the history
firebase 배포 및 ci/cd 연결
  • Loading branch information
ChoiSangwon authored Feb 3, 2024
2 parents 4ea01f5 + 866d966 commit 9370e4d
Show file tree
Hide file tree
Showing 8 changed files with 873 additions and 23 deletions.
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "pathtopet"
}
}
36 changes: 36 additions & 0 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy to Firebase Hosting on merge

"on":
push:
branches:
- main

jobs:
build_and_deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

# Setup Node.js environment
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "21"

# Install dependencies
- name: Install Dependencies
run: npm install # Or use yarn install

# Build the project
- name: Build
run: npm run build # Or use yarn build
env:
CI: false

- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_PATHTOPET }}"
channelId: live
projectId: pathtopet
33 changes: 33 additions & 0 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy to Firebase Hosting on PR

"on": pull_request

jobs:
build_and_preview:
if: "${{ github.event.pull_request.head.repo.full_name == github.repository }}"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

# Step to setup node environment, assuming the project is using Node.js
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "21" # Specify the Node.js version

# Step to install dependencies
- name: Install Dependencies
run: npm install # Or use yarn install if you're using Yarn

# Step to build the project
- name: Build
run: npm run build # Or use yarn build if you're using Yarn
env:
CI: false

- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_PATHTOPET }}"
projectId: pathtopet
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@

node_modules
node_modules

build

.firebase
6 changes: 6 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"hosting": {
"public": "build",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
}
}
Loading

0 comments on commit 9370e4d

Please sign in to comment.