From 6afa7592897472a75a6cb21f816e83f084652e3b Mon Sep 17 00:00:00 2001 From: Rene Enriquez Date: Tue, 14 Apr 2020 12:46:52 -0500 Subject: [PATCH 1/5] fix: #47 adding deployment notifications --- .github/workflows/CD-time-tracker-ui.yml | 69 +++++++++++++----------- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/.github/workflows/CD-time-tracker-ui.yml b/.github/workflows/CD-time-tracker-ui.yml index bab4fd134..90bb0a32e 100644 --- a/.github/workflows/CD-time-tracker-ui.yml +++ b/.github/workflows/CD-time-tracker-ui.yml @@ -4,42 +4,51 @@ name: CD process to deploy to App-Service service on: - # Trigger the workflow on pull request but only for the master branch - pull_request: - types: [closed] + push: branches: - - master + - 47-notify-deployments + # Trigger the workflow on pull request but only for the master branch + # pull_request: + # types: [closed] + # branches: + # - master jobs: build-and-deploy: - name: Deploy to Azure - runs-on: ubuntu-latest - timeout-minutes: 60 steps: - - name: Checkout of master - uses: actions/checkout@master + - uses: actions/checkout@v2 + - name: Slack Notification + uses: rtCamp/action-slack-notify@v2.0.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + # name: Deploy to Azure + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # steps: + # - name: Checkout of master + # uses: actions/checkout@master - - name: Set up Node.js version - uses: actions/setup-node@v1 - with: - node-version: '12.x' + # - name: Set up Node.js version + # uses: actions/setup-node@v1 + # with: + # node-version: '12.x' - - name: Inject Secrets - env: - SCOPES: ${{ secrets.scopes }} - CLIENT_ID: ${{ secrets.client_id }} - AUTHORITY: ${{ secrets.authority }} - run: sudo sh scripts/populate-keys.sh + # - name: Inject Secrets + # env: + # SCOPES: ${{ secrets.scopes }} + # CLIENT_ID: ${{ secrets.client_id }} + # AUTHORITY: ${{ secrets.authority }} + # run: sudo sh scripts/populate-keys.sh - - name: 'run: npm install and build' - run: | - npm install - npm run build --prod --if-present + # - name: 'run: npm install and build' + # run: | + # npm install + # npm run build --prod --if-present - - name: 'Deploy to Azure Web App' - uses: azure/webapps-deploy@v1 - with: - app-name: 'time-tracker-ui' - slot-name: 'production' - publish-profile: ${{ secrets.AzureAppService_PublishProfile_728dc744f9384bf38e8a0446aaaee29d }} - package: dist/time-tracker + # - name: 'Deploy to Azure Web App' + # uses: azure/webapps-deploy@v1 + # with: + # app-name: 'time-tracker-ui' + # slot-name: 'production' + # publish-profile: ${{ secrets.AzureAppService_PublishProfile_728dc744f9384bf38e8a0446aaaee29d }} + # package: dist/time-tracker From 4b29f545c748f11fa899178bbb4863f805b8d637 Mon Sep 17 00:00:00 2001 From: Rene Enriquez Date: Tue, 14 Apr 2020 12:48:12 -0500 Subject: [PATCH 2/5] fix: #47 adding deployment notifications --- .github/workflows/CD-time-tracker-ui.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CD-time-tracker-ui.yml b/.github/workflows/CD-time-tracker-ui.yml index 90bb0a32e..4b103502d 100644 --- a/.github/workflows/CD-time-tracker-ui.yml +++ b/.github/workflows/CD-time-tracker-ui.yml @@ -15,15 +15,15 @@ on: jobs: build-and-deploy: + name: Deploy to Azure + runs-on: ubuntu-latest + timeout-minutes: 60 steps: - uses: actions/checkout@v2 - name: Slack Notification uses: rtCamp/action-slack-notify@v2.0.0 env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - # name: Deploy to Azure - # runs-on: ubuntu-latest - # timeout-minutes: 60 # steps: # - name: Checkout of master # uses: actions/checkout@master From 79b3ff38659b8d83ff758d10e6383d14e124081b Mon Sep 17 00:00:00 2001 From: Rene Enriquez Date: Tue, 14 Apr 2020 12:55:19 -0500 Subject: [PATCH 3/5] fix: #47 adding deployment notifications --- .github/workflows/CD-time-tracker-ui.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CD-time-tracker-ui.yml b/.github/workflows/CD-time-tracker-ui.yml index 4b103502d..fd3299346 100644 --- a/.github/workflows/CD-time-tracker-ui.yml +++ b/.github/workflows/CD-time-tracker-ui.yml @@ -19,12 +19,6 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v2 - - name: Slack Notification - uses: rtCamp/action-slack-notify@v2.0.0 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - # steps: # - name: Checkout of master # uses: actions/checkout@master @@ -52,3 +46,14 @@ jobs: # slot-name: 'production' # publish-profile: ${{ secrets.AzureAppService_PublishProfile_728dc744f9384bf38e8a0446aaaee29d }} # package: dist/time-tracker + + - uses: actions/checkout@v2 + - name: Slack Notification + uses: rtCamp/action-slack-notify@v2.0.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_ICON: https://avatars.slack-edge.com/2020-04-14/1055222096486_7b0bf047c32f9f666b69_48.jpg + SLACK_TITLE: 'New deployment' + SLACK_USERNAME: 'heisenberg-says:' + SLACK_TITLE: 'New deployment...' + SLACK_MESSAGE: 'A new deployment has been executed successfully' From f503f57b7986b1bfda816fb787b15a7a663fe38c Mon Sep 17 00:00:00 2001 From: Rene Enriquez Date: Tue, 14 Apr 2020 12:56:20 -0500 Subject: [PATCH 4/5] fix: #47 adding deployment notifications --- .github/workflows/CD-time-tracker-ui.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/CD-time-tracker-ui.yml b/.github/workflows/CD-time-tracker-ui.yml index fd3299346..5e7e7b967 100644 --- a/.github/workflows/CD-time-tracker-ui.yml +++ b/.github/workflows/CD-time-tracker-ui.yml @@ -55,5 +55,4 @@ jobs: SLACK_ICON: https://avatars.slack-edge.com/2020-04-14/1055222096486_7b0bf047c32f9f666b69_48.jpg SLACK_TITLE: 'New deployment' SLACK_USERNAME: 'heisenberg-says:' - SLACK_TITLE: 'New deployment...' SLACK_MESSAGE: 'A new deployment has been executed successfully' From 21a5c0e879b262a4809b85b661b4c4cc0d08c2b7 Mon Sep 17 00:00:00 2001 From: Rene Enriquez Date: Tue, 14 Apr 2020 12:59:36 -0500 Subject: [PATCH 5/5] fix: #47 adding slack interaction after deployments --- .github/workflows/CD-time-tracker-ui.yml | 67 +++++++++++------------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/.github/workflows/CD-time-tracker-ui.yml b/.github/workflows/CD-time-tracker-ui.yml index 5e7e7b967..19578668a 100644 --- a/.github/workflows/CD-time-tracker-ui.yml +++ b/.github/workflows/CD-time-tracker-ui.yml @@ -4,14 +4,11 @@ name: CD process to deploy to App-Service service on: - push: - branches: - - 47-notify-deployments # Trigger the workflow on pull request but only for the master branch - # pull_request: - # types: [closed] - # branches: - # - master + pull_request: + types: [closed] + branches: + - master jobs: build-and-deploy: @@ -19,33 +16,33 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - # - name: Checkout of master - # uses: actions/checkout@master - - # - name: Set up Node.js version - # uses: actions/setup-node@v1 - # with: - # node-version: '12.x' - - # - name: Inject Secrets - # env: - # SCOPES: ${{ secrets.scopes }} - # CLIENT_ID: ${{ secrets.client_id }} - # AUTHORITY: ${{ secrets.authority }} - # run: sudo sh scripts/populate-keys.sh - - # - name: 'run: npm install and build' - # run: | - # npm install - # npm run build --prod --if-present - - # - name: 'Deploy to Azure Web App' - # uses: azure/webapps-deploy@v1 - # with: - # app-name: 'time-tracker-ui' - # slot-name: 'production' - # publish-profile: ${{ secrets.AzureAppService_PublishProfile_728dc744f9384bf38e8a0446aaaee29d }} - # package: dist/time-tracker + - name: Checkout of master + uses: actions/checkout@master + + - name: Set up Node.js version + uses: actions/setup-node@v1 + with: + node-version: '12.x' + + - name: Inject Secrets + env: + SCOPES: ${{ secrets.scopes }} + CLIENT_ID: ${{ secrets.client_id }} + AUTHORITY: ${{ secrets.authority }} + run: sudo sh scripts/populate-keys.sh + + - name: 'run: npm install and build' + run: | + npm install + npm run build --prod --if-present + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v1 + with: + app-name: 'time-tracker-ui' + slot-name: 'production' + publish-profile: ${{ secrets.AzureAppService_PublishProfile_728dc744f9384bf38e8a0446aaaee29d }} + package: dist/time-tracker - uses: actions/checkout@v2 - name: Slack Notification @@ -53,6 +50,6 @@ jobs: env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_ICON: https://avatars.slack-edge.com/2020-04-14/1055222096486_7b0bf047c32f9f666b69_48.jpg - SLACK_TITLE: 'New deployment' + SLACK_TITLE: 'Guess what?' SLACK_USERNAME: 'heisenberg-says:' SLACK_MESSAGE: 'A new deployment has been executed successfully'