-
Notifications
You must be signed in to change notification settings - Fork 46
54 lines (54 loc) · 2.01 KB
/
unrealiotingest-function.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Build and publish .NET Core Function App zip package
on:
push:
paths:
- 'function-code/UnrealIoTIngest/**'
- '!function-code/UnrealIoTIngest/funcapp-deploy.zip'
workflow_dispatch:
inputs:
comment:
description: "Run comments"
required: false
env:
DOTNET_CORE_VERSION: 3.1.x
WORKING_DIRECTORY: function-code/UnrealIoTIngest
PUBLISH_DIRECTORY: function-code/UnrealIoTIngest/bin/Publish
FLOW_EMAIL: [email protected]
FLOW_NAME: "github-actions"
jobs:
build-and-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: check current branch
run: git rev-parse --abbrev-ref HEAD
- name: Build
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_CORE_VERSION }}
- name: Restore
run: dotnet restore ${{ env.WORKING_DIRECTORY }}
- name: Build
run: dotnet build /p:DeployOnBuild=true /p:DeployTarget=Package ${{ env.WORKING_DIRECTORY }} --no-restore
- name: Publish
run: dotnet publish /p:CreatePackageOnPublish=true -o ${{ env.PUBLISH_DIRECTORY }} ${{ env.WORKING_DIRECTORY }}
- name: Package
shell: pwsh
run: Compress-Archive -Path ${{ env.PUBLISH_DIRECTORY }}/* -DestinationPath ${{ env.WORKING_DIRECTORY }}/funcapp-deploy.zip -Update
- name: Check for changes
run: git status
- name: Stage changed files
run: git add ${{ env.WORKING_DIRECTORY }}/funcapp-deploy.zip
- name: Commit changes
run: |
git config --local user.email ${{ env.FLOW_EMAIL }}
git config --local user.name ${{ env.FLOW_NAME }}
git commit -m "Adding Function App zip deploy packages"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}