Skip to content

Commit 71dedd4

Browse files
committed
including CD pipeline declaration on GithubActions
1 parent b8be91c commit 71dedd4

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CD Azure Functions deployment
2+
3+
4+
on:
5+
# Trigger the workflow on pull request but only for the master branch
6+
pull_request:
7+
types: [closed]
8+
branches:
9+
- master
10+
11+
env:
12+
AZURE_FUNCTIONAPP_NAME: 'time-tracker-azure-functions'
13+
AZURE_FUNCTIONAPP_PACKAGE_PATH: 'AutomaticClockOuts' # set this to the path to your web app project, defaults to the repository root
14+
15+
jobs:
16+
build-and-deploy:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@master
20+
- uses: actions/setup-node@v1
21+
with:
22+
node-version: '10.x'
23+
- name: 'run npm'
24+
run: |
25+
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
26+
cd AutomaticClockOuts
27+
npm i -g azure-functions-core-tools@core --unsafe-perm true
28+
az login -u ${{ secrets.AZ_USERNAME }} -p ${{ secrets.AZ_PASSWORD }}
29+
npm install
30+
func settings add FUNCTIONS_WORKER_RUNTIME node
31+
func azure functionapp publish time-tracker-azure-functions --node

AutomaticClockOuts/clock_out.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const doClockOut = async (context) => {
3232
if(totalClockOutsExecuted > 0){
3333
axios.post(slackWebHook,
3434
{
35-
"text": `Hey guys, I did a clock out for you. \nVisit https://timetracker.ioet.com/ and set the right end time for your entries :pls: \n- ${usersWithClockOut.join('\n- ')}`
35+
"text": `Hey guys, I just did a clock out for you. \nPlease visit https://timetracker.ioet.com/ and set the right end time for your entries :pls: \n- ${usersWithClockOut.join('\n- ')}`
3636
}
3737
)
3838
.then(function (response) {

AutomaticClockOuts/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func azure functionapp publish time-tracker-azure-functions
2929
```
3030

3131
NOTE:
32-
Don't forget to set the following environment variables to make this app work:
32+
Don't forget to set the following environment variables to make this app work locally:
3333

3434
```sh
3535
ENDPOINT='XXX'

0 commit comments

Comments
 (0)