Skip to content

Commit cf74f21

Browse files
authored
Merge pull request #28 from ioet/pipe
Pipe
2 parents 47f8dfc + e584fdd commit cf74f21

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed
Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
name: CD process to deploy to AzureFuncions
1+
name: CD Azure Functions deployment
22

33
on:
4-
# Trigger the workflow on pull request but only for the master branch
5-
pull_request:
6-
types: [closed]
4+
# Trigger the workflow on push or pull request,
5+
# but only for the main branch
6+
push:
77
branches:
8-
- master
8+
- pipe
99

1010
env:
11-
AZURE_FUNCTIONAPP_NAME: AutomaticClockOuts # set this to your application's name
12-
AZURE_FUNCTIONAPP_PACKAGE_PATH: './AutomaticClockOuts' # set this to the path to your web app project, defaults to the repository root
11+
AZURE_FUNCTIONAPP_NAME: 'time-tracker-azure-functions'
12+
AZURE_FUNCTIONAPP_PACKAGE_PATH: 'AutomaticClockOuts' # set this to the path to your web app project, defaults to the repository root
1313

1414
jobs:
1515
build-and-deploy:
@@ -21,14 +21,17 @@ jobs:
2121
node-version: '10.x'
2222
- name: 'run npm'
2323
run: |
24-
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
24+
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
25+
cd AutomaticClockOuts
26+
npm i -g azure-functions-core-tools@core --unsafe-perm true
27+
az login -u ${{ secrets.AZ_USERNAME }} -p ${{ secrets.AZ_PASSWORD }}
2528
npm install
26-
npm run build --if-present
27-
popd
28-
- name: 'Run Azure Functions Action'
29-
uses: Azure/functions-action@v1
30-
id: fa
31-
with:
32-
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
33-
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
34-
publish-profile: ${{ secrets.SCM_CREDENTIALS }}
29+
func settings add FUNCTIONS_WORKER_RUNTIME node
30+
func azure functionapp publish time-tracker-azure-functions --node
31+
# - name: 'Run Azure Functions Action'
32+
# uses: Azure/functions-action@v1
33+
# id: fa
34+
# with:
35+
# app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
36+
# package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
37+
# publish-profile: ${{ secrets.SCM_CREDENTIALS }}

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) {

0 commit comments

Comments
 (0)