From 2c4b1a4cb16a168bd25b9f3a6855e1d02552b892 Mon Sep 17 00:00:00 2001 From: jokj624 Date: Sat, 27 Jul 2024 23:54:30 +0900 Subject: [PATCH] =?UTF-8?q?hotfix(workflows):=20firebase=20token=20?= =?UTF-8?q?=EB=AA=85=EC=8B=9C=EC=A0=81=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/prod.yml | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index bb6f856..b6de308 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -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 @@ -59,14 +58,14 @@ 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 @@ -74,7 +73,7 @@ jobs: with: name: "havit-production-firebase-adminsdk-bypl1-d081cc62e4.json" json: ${{ secrets.PROD_FIREBASE_JSON }} - dir: 'functions/' + dir: "functions/" - name: Install npm pacakges run: | @@ -82,13 +81,13 @@ jobs: 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 @@ -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. \ No newline at end of file + if: always() # Pick up events even if the job fails or is canceled.