-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e022675
commit 060be06
Showing
1 changed file
with
17 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,27 @@ | ||
# .github/workflows/deploy-dev.yml | ||
|
||
name: Deploy to Dev | ||
name: Deploy Firebase Function | ||
|
||
on: push | ||
# push: | ||
# branches: | ||
# - main | ||
# workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
env: | ||
GOOGLE_APPLICATION_CREDENTIALS: google-application-credentials.json | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
name: Checkout | ||
|
||
- uses: subosito/[email protected] | ||
name: Set up Flutter SDK | ||
with: | ||
channel: 'stable' | ||
cache: true | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
- uses: actions/setup-node@v2 | ||
name: Setup Node.js | ||
with: | ||
node-version: 18 | ||
|
||
|
@@ -38,7 +41,6 @@ jobs: | |
echo "Working directory: $(pwd)" | ||
|
||
- name: Install Dependencies | ||
shell: bash | ||
working-directory: ./functions | ||
run: | | ||
npm ci | ||
|
@@ -55,20 +57,20 @@ jobs: | |
echo "Working directory: $(pwd)" | ||
|
||
- name: Prepare Google Application Credentials | ||
shell: bash | ||
env: | ||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} | ||
run: | | ||
echo "${{ secrets.DEV_GOOGLE_APPLICATION_CREDENTIALS }}" | base64 --decode > "google-application-credentials.json" | ||
cd khelo | ||
echo $GOOGLE_APPLICATION_CREDENTIALS | base64 -di > functions/google-application-credentials.json | ||
- name: Use Firebase Dev | ||
shell: bash | ||
run: | | ||
firebase use dev --debug | ||
- name: Deploy Firebase functions | ||
shell: bash | ||
run: firebase deploy --only functions --non-interactive --debug | ||
|
||
- name: Remove credentials file | ||
if: success() || failure() | ||
run: | | ||
rm google-application-credentials.json | ||
rm functions/google-application-credentials.json |