Skip to content

Commit

Permalink
Merge tag '20240727-1' into develop
Browse files Browse the repository at this point in the history
   20240727-1
  • Loading branch information
jokj624 committed Jul 27, 2024
2 parents fe71e62 + dd1efac commit f665019
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,21 @@ name: firebase functions deploy - prod server
on:
# Triggers the workflow on push or pull request events but only for the develop branch
push:
branches: [ main ]
branches: [main]

jobs:
main:
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v2

- name: Setting Slack API
run: |
touch deployMessageToSlack.sh
echo 'curl -X POST -H 'Content-type: application/json' --data "{\"text\":\" [DEPLOY] [HAVIT_SERVER] deployment successful.\", \"icon_emoji\": \":ghost:\"}" ${{ secrets.PROD_WEB_HOOK_ERROR_MONITORING }}' >> deployMessageToSlack.sh
chmod 755 deployMessageToSlack.sh
touch deployMessageToSlack.sh
echo 'curl -X POST -H 'Content-type: application/json' --data "{\"text\":\" [DEPLOY] [HAVIT_SERVER] deployment successful.\", \"icon_emoji\": \":ghost:\"}" ${{ secrets.PROD_WEB_HOOK_ERROR_MONITORING }}' >> deployMessageToSlack.sh
chmod 755 deployMessageToSlack.sh
- name: create env file
run: |
cd functions
Expand Down Expand Up @@ -59,36 +58,36 @@ jobs:
cd functions
touch ${{ secrets.APPLE_PRIVATE_KEY_FILE }}
echo "${{ secrets.APPLE_PRIVATE_KEY }}" > ${{ secrets.APPLE_PRIVATE_KEY_FILE }}
- name: create-json
id: create-json
id: create-dev-json
uses: jsdaniell/create-json@1.1.2
with:
name: "havit-wesopt29-firebase-adminsdk-mgljp-478046b091.json"
json: ${{ secrets.FIREBASE_JSON }}
dir: 'functions/'
dir: "functions/"

- name: create-json
id: create-prod-json
uses: jsdaniell/create-json@v1.1.2
with:
name: "havit-production-firebase-adminsdk-bypl1-d081cc62e4.json"
json: ${{ secrets.PROD_FIREBASE_JSON }}
dir: 'functions/'
dir: "functions/"

- name: Install npm pacakges
run: |
cd functions
npm install
npm install -g firebase-tools
npm install --save-dev cross-env
- name: Deploy to Firebase
run: |
cd functions
firebase use prod
npm run deploy
env:
firebase use prod --token ${{ secrets.PROD_FIREBASE_TOKEN }}
npm run deploy --token ${{ secrets.PROD_FIREBASE_TOKEN }}
env:
FIREBASE_TOKEN: ${{ secrets.PROD_FIREBASE_TOKEN }}

- name: action-slack
Expand All @@ -99,4 +98,4 @@ jobs:
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
env:
SLACK_WEBHOOK_URL: ${{ secrets.PROD_SLACK_BUILD_WEBHOOK_URL }} # required
if: always() # Pick up events even if the job fails or is canceled.
if: always() # Pick up events even if the job fails or is canceled.

0 comments on commit f665019

Please sign in to comment.