diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8865149d..a73ba15d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,20 +15,9 @@ jobs: with: node-version: ${{ secrets.NODE_VERSION }} - name: Build & deploy - id: build-deploy run: | chmod +x ./.github/workflows/app.sh ./.github/workflows/app.sh - - name: Notify on slack - if: always() - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_APPS }} - SLACK_USERNAME: GitHub Actions - SLACK_ICON: https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png - SLACK_COLOR: ${{ steps.build-deploy.outcome == 'success' && 'good' || 'danger' }} - SLACK_MESSAGE: Build of ${{ github.repository }}@${{ github.ref_name }} by ${{ github.actor }} ${{ steps.build-deploy.outcome == 'success' && 'passed' || 'failed' }} - SLACK_FOOTER: doc: if: ${{ contains(github.event.head_commit.message, '[build doc]') }} runs-on: ubuntu-latest @@ -44,4 +33,19 @@ jobs: - name: Deploy doc to GitHub Pages uses: JamesIves/github-pages-deploy-action@v4 with: - folder: docs/.vitepress/dist \ No newline at end of file + folder: docs/.vitepress/dist + slackNotification: + name: Notify on slack + runs-on: ubuntu-latest + needs: [app, doc] + steps: + - uses: actions/checkout@v4 + - name: Notify on slack + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_APPS }} + SLACK_USERNAME: GitHub Actions + SLACK_ICON: https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png + SLACK_COLOR: ${{ (needs.app.reult == 'success' && needs.doc.reult == 'success') && 'good' || 'danger' }} + SLACK_MESSAGE: Build of ${{ github.repository }}@${{ github.ref_name }} by ${{ github.actor }} ${{ (needs.app.reult == 'success' && needs.doc.reult == 'success') && 'passed' || 'failed' }} + SLACK_FOOTER: \ No newline at end of file