Skip to content

Commit

Permalink
ci: add firebase deploy actions
Browse files Browse the repository at this point in the history
  • Loading branch information
helder-moreira committed Mar 27, 2023
1 parent eb8a44f commit c827866
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"projects": {
"default": "nibiru-chain"
},
"targets": {
"nibiru-chain": {
"hosting": {
"explorer": [
"nibiru-explorer"
]
}
}
},
"etags": {}
}
31 changes: 31 additions & 0 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy to Preview Channel

on: pull_request

jobs:
build_and_preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Cache node_modules
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/yarn.lock') }}

- uses: borales/[email protected]
with:
cmd: install

- uses: borales/[email protected]
with:
cmd: build

- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_NIBIRU_CHAIN }}"
projectId: nibiru-chain
expires: 14d
target: explorer
34 changes: 34 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Deploy to Live Channel

on:
push:
branches:
- master

jobs:
deploy_live_website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Cache node_modules
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/yarn.lock') }}

- uses: borales/[email protected]
with:
cmd: install

- uses: borales/[email protected]
with:
cmd: build

- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
projectId: nibiru-chain
channelId: live
target: explorer
16 changes: 16 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}

0 comments on commit c827866

Please sign in to comment.