Skip to content

Commit

Permalink
feat: add deployment to firebase (#9)
Browse files Browse the repository at this point in the history
fixes #7
  • Loading branch information
sonallux authored Oct 1, 2023
1 parent e6cda6d commit da12ef6
Show file tree
Hide file tree
Showing 6 changed files with 4,314 additions and 50 deletions.
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "angular-spotify-client-d93b7"
}
}
28 changes: 28 additions & 0 deletions .github/workflows/firebase-hosting-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy

on:
push:
branches:
- main
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_ANGULAR_SPOTIFY_CLIENT_D93B7 }}'
channelId: live
projectId: angular-spotify-client-d93b7
26 changes: 26 additions & 0 deletions .github/workflows/firebase-hosting-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy preview on PR

on: pull_request

jobs:
deploy_preview:
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
name: Deploy preview on PR
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_ANGULAR_SPOTIFY_CLIENT_D93B7 }}'
projectId: angular-spotify-client-d93b7
13 changes: 13 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"hosting": {
"source": ".",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"frameworksBackend": {
"region": "europe-west1"
}
}
}
Loading

0 comments on commit da12ef6

Please sign in to comment.