Skip to content

Commit

Permalink
feat: added env vars to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
GilTRipper committed Aug 19, 2024
1 parent 6498480 commit 6373cb5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VITE_FIREBASE_API_KEY=
VITE_FIREBASE_AUTH_DOMAIN=
VITE_FIREBASE_PROJECT_ID=
VITE_FIREBASE_STORAGE_BUCKER=
VITE_FIREBASE_STORAGE_BUCKET=
VITE_FIREBASE_MESSAGING_SENDER_ID=
VITE_FIREBASE_APP_ID=
VITE_FIREBASE_MEASUREMENT_ID=
8 changes: 8 additions & 0 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on merge
env:
VITE_FIREBASE_API_KEY: ${{vars.VITE_FIREBASE_API_KEY}}
VITE_FIREBASE_AUTH_DOMAIN: ${{vars.VITE_FIREBASE_AUTH_DOMAIN}}
VITE_FIREBASE_PROJECT_ID: ${{vars.VITE_FIREBASE_PROJECT_ID}}
VITE_FIREBASE_STORAGE_BUCKET: ${{vars.VITE_FIREBASE_STORAGE_BUCKET}}
VITE_FIREBASE_MESSAGING_SENDER_ID: ${{vars.VITE_FIREBASE_MESSAGING_SENDER_ID}}
VITE_FIREBASE_APP_ID: ${{vars.VITE_FIREBASE_APP_ID}}
VITE_FIREBASE_MEASUREMENT_ID: ${{vars.VITE_FIREBASE_MEASUREMENT_ID}}
on:
push:
branches:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on PR
env:
VITE_FIREBASE_API_KEY: ${{vars.VITE_FIREBASE_API_KEY}}
VITE_FIREBASE_AUTH_DOMAIN: ${{vars.VITE_FIREBASE_AUTH_DOMAIN}}
VITE_FIREBASE_PROJECT_ID: ${{vars.VITE_FIREBASE_PROJECT_ID}}
VITE_FIREBASE_STORAGE_BUCKET: ${{vars.VITE_FIREBASE_STORAGE_BUCKET}}
VITE_FIREBASE_MESSAGING_SENDER_ID: ${{vars.VITE_FIREBASE_MESSAGING_SENDER_ID}}
VITE_FIREBASE_APP_ID: ${{vars.VITE_FIREBASE_APP_ID}}
VITE_FIREBASE_MEASUREMENT_ID: ${{vars.VITE_FIREBASE_MEASUREMENT_ID}}
on: pull_request
permissions:
checks: write
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,5 @@ yarn-error.log
dist/
web-build/

.env
.env
.firebase
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
apiKey:import.meta.env.VITE_FIREBASE_API_KEY,
authDomain: import.meta.env.VITE_FIREBASE_AUTH_DOMAIN,
projectId: import.meta.env.VITE_FIREBASE_PROJECT_ID,
storageBucket: import.meta.env.VITE_FIREBASE_STORAGE_BUCKER,
storageBucket: import.meta.env.VITE_FIREBASE_STORAGE_BUCKET,
messagingSenderId: import.meta.env.VITE_FIREBASE_MESSAGING_SENDER_ID,
appId: import.meta.env.VITE_FIREBASE_APP_ID,
measurementId: import.meta.env.VITE_FIREBASE_MEASUREMENT_ID,
Expand Down

0 comments on commit 6373cb5

Please sign in to comment.