Skip to content

Commit

Permalink
Configure github actions to PR and main merge (#13)
Browse files Browse the repository at this point in the history
* Initial deployment graph app (#8)

* removed unnused imports

* fixed spell errors on README

* searchbar with logo and footer v1.0

* aligned logo with search buttons and minor styling fixes

* changed analyze text, added icons to the buttons and text to footer

* fixed footer margins

* removed unused imports and comments unused variables

* Feature/landing page (#5)

* a

* removed unused imports and comments unused variables

* Fix everything

* removed unused imports and comments unused variables

* Initial deploy of graph app (#2)

* removed unnused imports

* fixed spell errors on README

* searchbar with logo and footer v1.0

* aligned logo with search buttons and minor styling fixes

* changed analyze text, added icons to the buttons and text to footer

* fixed footer margins

* removed unused imports and comments unused variables

* removed unused imports and comments unused variables

* add github action to deploy on pull request

* fixed github actions to deploy app to firebase

* ignore -.firebase directory

---------

Co-authored-by: Pedro Ribeiro <[email protected]>

* Initial deployment graph app (#7)

* a

* removed unused imports and comments unused variables

* Fix everything

* removed unused imports and comments unused variables

* Initial deploy of graph app (#2)

* removed unnused imports

* fixed spell errors on README

* searchbar with logo and footer v1.0

* aligned logo with search buttons and minor styling fixes

* changed analyze text, added icons to the buttons and text to footer

* fixed footer margins

* removed unused imports and comments unused variables

* removed unused imports and comments unused variables

* add github action to deploy on pull request

* fixed github actions to deploy app to firebase

* ignore -.firebase directory

* Revert "Initial deploy of graph app" (#6)

---------

Co-authored-by: Pedro Ribeiro <[email protected]>

---------

Co-authored-by: Pedro Ribeiro <[email protected]>

* added google analytics to firebase configuration

* new google analytics event on search address

* ignores .env.developement and .env.prod

* configured github action to deploy when PR merged into main and to deploy to temporary URL when PR is created

* add comments to github actions files

* set an expiration period for temporary url and fixed projectId

* new github action to deploy on merge to development environment

* rename github action file

* fixed pre build command issue

* added new comment to github actions files

* add firebase.json file

* added env variables to github actions script

* add echo command to debug

---------

Co-authored-by: Pedro Ribeiro <[email protected]>
  • Loading branch information
Rodriguespn and tubarao312 authored Jan 15, 2024
1 parent 8f856e9 commit f121d1b
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 8 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/firebase-dev-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Configuration for deploying to production on merge to development
# For more information, see https://github.com/marketplace/actions/deploy-to-firebase-hosting#options

name: Deploy to Firebase Dev Hosting on merge
"on":
push:
branches:
- development

env:
VITE_WARD_API_BASE_URL: "https://wardanalyticsapi.com"
VITE_WARD_API_KEY: ${{ secrets.WARD_API_KEY }}
VITE_FIREBASE_API_KEY: "AIzaSyBZCnEQus6G42SodGNRf6o2zmBnGN0nXes"
VITE_FIREBASE_AUTH_DOMAIN: "graphapp-dev.firebaseapp.com"
VITE_FIREBASE_PROJECT_ID: "graphapp-dev"
VITE_FIREBASE_STORAGE_BUCKET: "graphapp-dev.appspot.com"
VITE_FIREBASE_MESSAGING_SENDER_ID: "897485812844"
VITE_FIREBASE_APP_ID: "1:897485812844:web:039de3b976c1559fded449"
# For Google Analytics
VITE_FIREBASE_MEASUREMENT_ID: "G-V2S9JPMH7S"

jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: yarn install && yarn build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_GRAPHAPP_DEV }}"
channelId: live
projectId: graphapp-dev
23 changes: 18 additions & 5 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools
# Configuration for deploying to production on merge to main
# For more information, see https://github.com/marketplace/actions/deploy-to-firebase-hosting#options

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

env:
VITE_WARD_API_BASE_URL: https://wardanalyticsapi.com
VITE_WARD_API_KEY: ${{ secrets.WARD_API_KEY }}
VITE_FIREBASE_API_KEY: AIzaSyD1LUGU2RM-bhxKgeYdnzItbwBC0VSTOV0
VITE_FIREBASE_AUTH_DOMAIN: graphapp-bca04.firebaseapp.com
VITE_FIREBASE_PROJECT_ID: graphapp-bca04
VITE_FIREBASE_STORAGE_BUCKET: graphapp-bca04.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID: "1030502540585"
VITE_FIREBASE_APP_ID: "1:1030502540585:web:cfe727695aad44d0494338"
# For Google Analytics
VITE_FIREBASE_MEASUREMENT_ID: G-RYB03B2Q13

jobs:
build_and_deploy:
runs-on: ubuntu-latest
Expand All @@ -14,7 +27,7 @@ jobs:
- run: yarn install && yarn build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_GRAPHAPP_BCA04 }}'
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_GRAPHAPP_BCA04 }}"
channelId: live
projectId: graphapp-bca04
22 changes: 20 additions & 2 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools
# Configuration for deploy a preview of the PR to a temporary url
# The goal is to be able to test the PR before merging it
# This action is triggered on every PR, regardless of the branch
# The preview url has a lifetime of 7 days
# For more information, see https://github.com/marketplace/actions/deploy-to-firebase-hosting#options

name: Deploy to Firebase Hosting on PR
"on": pull_request

env:
VITE_WARD_API_BASE_URL: "https://wardanalyticsapi.com"
VITE_WARD_API_KEY: ${{ secrets.WARD_API_KEY }}
VITE_FIREBASE_API_KEY: "AIzaSyD1LUGU2RM-bhxKgeYdnzItbwBC0VSTOV0"
VITE_FIREBASE_AUTH_DOMAIN: "graphapp-bca04.firebaseapp.com"
VITE_FIREBASE_PROJECT_ID: "graphapp-bca04"
VITE_FIREBASE_STORAGE_BUCKET: "graphapp-bca04.appspot.com"
VITE_FIREBASE_MESSAGING_SENDER_ID: "1030502540585"
VITE_FIREBASE_APP_ID: "1:1030502540585:web:cfe727695aad44d0494338"
# For Google Analytics
VITE_FIREBASE_MEASUREMENT_ID: "G-RYB03B2Q13"

jobs:
build_and_preview:
if: "${{ github.event.pull_request.head.repo.full_name == github.repository }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: yarn install && yarn build
- run: echo "$VITE_FIREBASE_PROJECT_ID"
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_GRAPHAPP_BCA04 }}"
expires: 7d
projectId: graphapp-bca04
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ dist-ssr
build
*.local
.env
.env.development
.env.test
.env.production

# Yarn installation state file
.yarn/install-state.gz

# Firebase
.firebase/*
firebase.json
.firebaserc

# Editor directories and files
Expand Down
16 changes: 16 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}

0 comments on commit f121d1b

Please sign in to comment.