Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: #47 adding slack interaction after deployments
  • Loading branch information
enriquezrene committed Apr 14, 2020
commit 21a5c0e879b262a4809b85b661b4c4cc0d08c2b7
67 changes: 32 additions & 35 deletions .github/workflows/CD-time-tracker-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,52 @@
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:
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: 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
uses: rtCamp/[email protected]
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'