-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (61 loc) · 2.15 KB
/
main.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
68
69
70
71
name: CI/CD
on:
push:
pull_request:
env:
PROJECT_NAME: epaper-meetingroom-display-server
DOCKER_IMAGE: ghcr.io/${{ github.repository }}/${{ github.event.repository.name }}
DOCKER_TAG: ${{ github.sha }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v1
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore NOITechParkDoorSignage.sln
- name: Build
run: dotnet build NOITechParkDoorSignage.sln --no-restore
- name: Test
run: dotnet test NOITechParkDoorSignage.sln --no-build --verbosity normal
deploy-test:
runs-on: ubuntu-20.04
if: github.ref == 'refs/heads/main'
needs: test
concurrency: deploy-test
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Create .env file
uses: noi-techpark/github-actions/env-file@v2
env:
X_COMPOSE_PROJECT_NAME: ${{ env.PROJECT_NAME }}
X_DOCKER_IMAGE: ${{ env.DOCKER_IMAGE }}
X_DOCKER_TAG: ${{ env.DOCKER_TAG }}
X_SERVER_PORT: 1040
X_ASPNETCORE_ENVIRONMENT: "Development"
X_LOG_PATH: ${{ secrets.LOG_PATH }}
X_LOG_LEVEL: "Debug"
X_AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
X_AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
X_AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
- name: Build and push
uses: noi-techpark/github-actions/docker-build-and-push@v2
with:
docker-username: ${{ github.actor }}
docker-password: ${{ secrets.GITHUB_TOKEN }}
working-directory: ./
docker-compose-file: docker-compose.yml
- name: Deploy application
uses: noi-techpark/github-actions/docker-deploy@v2
with:
hosts: 'test'
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
docker-username: 'noi-techpark-bot'
docker-password: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
project-name: ${{ env.PROJECT_NAME }}