-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (53 loc) · 1.78 KB
/
ci-cd.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
55
56
57
58
59
60
61
62
63
64
65
66
67
name: ci-cd
on:
push:
branches: [ main ]
env:
AZURE_WEBAPP_NAME: celebrity-api
PUBLISH_PATH: '.'
jobs:
continuos-integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Install dependencies
run: dotnet restore
- name: Build and Publish
run: |
dotnet build --configuration Release --no-restore
dotnet publish src/NewCelebrities.Host/NewCelebrities.Host.csproj -c Release -o '${{ env.PUBLISH_PATH }}/app'
- name: Run unit tests
run: dotnet test --no-restore --verbosity normal test/NewCelebrities.UnitTests/NewCelebrities.UnitTests.csproj
- name: Run functional tests
run: dotnet test --no-restore --verbosity normal test/NewCelebrities.FunctionalTests/NewCelebrities.FunctionalTests.csproj
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: webapp-artifact
path: ${{env.PUBLISH_PATH}}/app
deploy-api-to-azure:
needs: [continuos-integration]
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: webapp-artifact
path: ${{env.PUBLISH_PATH}}/app
- name: Variable Substitution
uses: microsoft/variable-substitution@v1
with:
files: '${{ env.PUBLISH_PATH }}/app/appsettings.json'
env:
ConnectionStrings.Supabase : "${{ secrets.SUPABASE_CONNECTION }}"
- name: Azure WebApp
uses: Azure/webapps-deploy@v2
with:
# Name of the Azure Web App
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.PUBLISHPROFILE }}
package: '${{ env.PUBLISH_PATH }}/app'