-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (47 loc) · 1.9 KB
/
SoftAsInSoftware.api.yml
File metadata and controls
51 lines (47 loc) · 1.9 KB
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
# This is a basic workflow to help you get started with Actions
name: Build and Deploy API
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [master]
pull_request:
branches: [master]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
AZURE_WEBAPI_NAME: SoftAsInSoftwareAPI
AZURE_WEBAPI_PACKAGE_PATH: softasinsoftware.API/publish
AZURE_WEBAPI_PUBLISH_PROFILE: ${{ secrets.AZURE_WEBAPI_PUBLISH_PROFILE }}
CONFIGURATION: Release
DOTNET_CORE_VERSION: 8.0.x
WORKING_DIRECTORY: ./softasinsoftware.com/softasinsoftware.API
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-and-deploy:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_CORE_VERSION }}
- name: Restore
run: dotnet restore "${{ env.WORKING_DIRECTORY }}"
- name: Build Web
run: dotnet build "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-restore
- name: Test
run: dotnet test "${{ env.WORKING_DIRECTORY }}" --no-build
- name: Publish
run: dotnet publish "${{ env.WORKING_DIRECTORY }}" --runtime win-x64 --self-contained --configuration ${{ env.CONFIGURATION }} --output "${{ env.AZURE_WEBAPI_PACKAGE_PATH }}"
- name: Deploy to Azure WebApp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPI_NAME }}
package: ${{ env.AZURE_WEBAPI_PACKAGE_PATH }}
publish-profile: ${{ env.AZURE_WEBAPI_PUBLISH_PROFILE }}
- name: Publish Artifacts
uses: actions/upload-artifact@v1.0.0
with:
name: webapp
path: ${{ env.AZURE_WEBAPI_PACKAGE_PATH }}