diff --git a/.github/workflows/platformDeploy.yml b/.github/workflows/platformDeploy.yml index 4a684de900bc..4cd4e5ba56d5 100644 --- a/.github/workflows/platformDeploy.yml +++ b/.github/workflows/platformDeploy.yml @@ -347,7 +347,7 @@ jobs: env: CF_API_KEY: ${{ secrets.CLOUDFLARE_TOKEN }} - postSlackMessage: + postSlackMessageOnFailure: name: Post a Slack message when any platform fails to build or deploy runs-on: ubuntu-latest if: ${{ failure() }} @@ -371,46 +371,13 @@ jobs: GITHUB_TOKEN: ${{ github.token }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - postGithubComment: - name: Post a GitHub comment when platforms are done building and deploying + postSlackMessageOnSuccess: + name: Post a Slack message when all platforms deploy successfully runs-on: ubuntu-latest - if: ${{ always() }} + if: ${{ success() }} needs: [android, desktop, iOS, web] steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Node - uses: actions/setup-node@v1 - with: - node-version: '14.x' - - - name: Set version - run: echo "VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV" - - - name: Get Release Pull Request List - id: getReleasePRList - uses: Expensify/App/.github/actions/getDeployPullRequestList@main - with: - TAG: ${{ env.VERSION }} - GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} - IS_PRODUCTION_DEPLOY: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} - - - name: Comment on issues - uses: Expensify/App/.github/actions/markPullRequestsAsDeployed@main - with: - PR_LIST: ${{ steps.getReleasePRList.outputs.PR_LIST }} - IS_PRODUCTION_DEPLOY: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} - DEPLOY_VERSION: ${{ env.VERSION }} - GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} - ANDROID: ${{ needs.android.result }} - DESKTOP: ${{ needs.desktop.result }} - IOS: ${{ needs.iOS.result }} - WEB: ${{ needs.web.result }} - - name: 'Announces the deploy in the #announce Slack room' - if: ${{ success() }} uses: 8398a7/action-slack@v3 with: status: custom @@ -427,7 +394,6 @@ jobs: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - name: 'Announces the deploy in the #deployer Slack room' - if: ${{ success() }} uses: 8398a7/action-slack@v3 with: status: custom @@ -445,7 +411,7 @@ jobs: - name: 'Announces a production deploy in the #expensify-open-source Slack room' uses: 8398a7/action-slack@v3 - if: ${{ success() && fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} + if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} with: status: custom custom_payload: | @@ -459,3 +425,41 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + + postGithubComment: + name: Post a GitHub comment when platforms are done building and deploying + runs-on: ubuntu-latest + if: ${{ always() }} + needs: [android, desktop, iOS, web] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: '14.x' + + - name: Set version + run: echo "VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV" + + - name: Get Release Pull Request List + id: getReleasePRList + uses: Expensify/App/.github/actions/getDeployPullRequestList@main + with: + TAG: ${{ env.VERSION }} + GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} + IS_PRODUCTION_DEPLOY: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} + + - name: Comment on issues + uses: Expensify/App/.github/actions/markPullRequestsAsDeployed@main + with: + PR_LIST: ${{ steps.getReleasePRList.outputs.PR_LIST }} + IS_PRODUCTION_DEPLOY: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} + DEPLOY_VERSION: ${{ env.VERSION }} + GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} + ANDROID: ${{ needs.android.result }} + DESKTOP: ${{ needs.desktop.result }} + IOS: ${{ needs.iOS.result }} + WEB: ${{ needs.web.result }}