Skip to content
Merged

Pipe #28

Show file tree
Hide file tree
Changes from all commits
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
37 changes: 20 additions & 17 deletions .github/workflows/CD-azure-functions.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: CD process to deploy to AzureFuncions
name: CD Azure Functions deployment

on:
# Trigger the workflow on pull request but only for the master branch
pull_request:
types: [closed]
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- master
- pipe

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

jobs:
build-and-deploy:
Expand All @@ -21,14 +21,17 @@ jobs:
node-version: '10.x'
- name: 'run npm'
run: |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
cd AutomaticClockOuts
npm i -g azure-functions-core-tools@core --unsafe-perm true
az login -u ${{ secrets.AZ_USERNAME }} -p ${{ secrets.AZ_PASSWORD }}
npm install
npm run build --if-present
popd
- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.SCM_CREDENTIALS }}
func settings add FUNCTIONS_WORKER_RUNTIME node
func azure functionapp publish time-tracker-azure-functions --node
# - name: 'Run Azure Functions Action'
# uses: Azure/functions-action@v1
# id: fa
# with:
# app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
# package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
# publish-profile: ${{ secrets.SCM_CREDENTIALS }}
2 changes: 1 addition & 1 deletion AutomaticClockOuts/clock_out.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const doClockOut = async (context) => {
if(totalClockOutsExecuted > 0){
axios.post(slackWebHook,
{
"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- ')}`
"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- ')}`
}
)
.then(function (response) {
Expand Down