-
Notifications
You must be signed in to change notification settings - Fork 2
121 lines (99 loc) · 5.01 KB
/
deploy.yaml
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Deploy
on:
push:
branches:
- prod
jobs:
DeployNuget:
runs-on: ubuntu-latest
env:
ResQueueImageVersion: "1.0.9"
DockerRegistry: ghcr.io
DockerRepository: filipbekic01/resqueue
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: "9.0.x"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Install Node dependencies
working-directory: frontend
run: npm ci
- name: Build Vue frontend
working-directory: frontend
run: npm run build:prod
- name: Build the project
working-directory: backend/ResQueue/ResQueue
run: dotnet build --configuration Release
- name: Pack the NuGet package
working-directory: backend/ResQueue/ResQueue
run: dotnet pack --configuration Release
- name: Push the NuGet package
working-directory: backend/ResQueue/ResQueue
run: dotnet nuget push bin/Release/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://nuget.org
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish x64 image
working-directory: backend/ResQueue/ResQueue.Standalone
run: dotnet publish --os linux --arch x64 /t:PublishContainer -p:PublishToGithubRegistry=true -p:ContainerImageTag=${ResQueueImageVersion} -p:ContainerRepository=${DockerRepository} -p:ContainerRegistry=${DockerRegistry} -pContainerImageTag=${ResQueueImageVersion}-x64
- name: Publish arm64 image
working-directory: backend/ResQueue/ResQueue.Standalone
run: dotnet publish --os linux --arch arm64 /t:PublishContainer -p:PublishToGithubRegistry=true -p:ContainerImageTag=${ResQueueImageVersion} -p:ContainerRepository=${DockerRepository} -p:ContainerRegistry=${DockerRegistry} -pContainerImageTag=${ResQueueImageVersion}-arm64
- name: Publish image manifest
run: |
set -e
docker manifest create "${DockerRegistry}/${DockerRepository}:${ResQueueImageVersion}" "${DockerRegistry}/${DockerRepository}:${ResQueueImageVersion}-x64" "${DockerRegistry}/${DockerRepository}:${ResQueueImageVersion}-arm64"
docker manifest tag "${DockerRegistry}/${DockerRepository}:${ResQueueImageVersion}" "${DockerRegistry}/${DockerRepository}:latest"
docker manifest push "${DockerRegistry}/${DockerRepository}:${ResQueueImageVersion}"
docker manifest push "${DockerRegistry}/${DockerRepository}:latest"
DeployImage:
runs-on: ubuntu-latest
env:
ResQueueImageVersion: "1.0.9"
DockerRegistry: ghcr.io
DockerRepository: filipbekic01/resqueue
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: "9.0.x"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Install Node dependencies
working-directory: frontend
run: npm ci
- name: Build Vue frontend
working-directory: frontend
run: npm run build:prod
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish x64 image
working-directory: backend/ResQueue/ResQueue.Standalone
run: dotnet publish --os linux --arch x64 /t:PublishContainer -p:PublishToGithubRegistry=true -p:ContainerImageTag=${ResQueueImageVersion} -p:ContainerRepository=${DockerRepository} -p:ContainerRegistry=${DockerRegistry} -p:ContainerImageTag=${ResQueueImageVersion}-x64
- name: Publish arm64 image
working-directory: backend/ResQueue/ResQueue.Standalone
run: dotnet publish --os linux --arch arm64 /t:PublishContainer -p:PublishToGithubRegistry=true -p:ContainerImageTag=${ResQueueImageVersion} -p:ContainerRepository=${DockerRepository} -p:ContainerRegistry=${DockerRegistry} -p:ContainerImageTag=${ResQueueImageVersion}-arm64
- name: Publish image manifest
run: |
set -e
docker manifest create "${DockerRegistry}/${DockerRepository}:${ResQueueImageVersion}" "${DockerRegistry}/${DockerRepository}:${ResQueueImageVersion}-x64" "${DockerRegistry}/${DockerRepository}:${ResQueueImageVersion}-arm64"
docker manifest push "${DockerRegistry}/${DockerRepository}:${ResQueueImageVersion}"
docker manifest create "${DockerRegistry}/${DockerRepository}:latest" "${DockerRegistry}/${DockerRepository}:${ResQueueImageVersion}-x64" "${DockerRegistry}/${DockerRepository}:${ResQueueImageVersion}-arm64"
docker manifest push "${DockerRegistry}/${DockerRepository}:latest"