-
Notifications
You must be signed in to change notification settings - Fork 44
113 lines (94 loc) · 3 KB
/
docker-image-pre-release.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
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
name: Docker Image (pre-release)
on:
push:
branches: [ pre-release ]
env:
DOTNET_VERSION: '8.0.100' # The .NET SDK version to use
jobs:
test:
runs-on: ubuntu-latest
name: Run Test Cases
services:
mariadb:
image: mariadb:latest
ports:
- 3306:3306
env:
MARIADB_DATABASE: openbudgeteer
MARIADB_USER: openbudgeteer
MARIADB_PASSWORD: openbudgeteer
MARIADB_ROOT_PASSWORD: openbudgeteer
options: >-
--health-cmd="healthcheck.sh --connect --innodb_initialized"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install Blazor dependencies
run: dotnet restore OpenBudgeteer.Blazor
- name: Build Blazor
run: dotnet build OpenBudgeteer.Blazor --configuration Release --no-restore
- name: Run Core Test Cases
env:
CONNECTION_PROVIDER: mariadb
CONNECTION_SERVER: localhost
CONNECTION_PORT: 3306
CONNECTION_USER: openbudgeteer
CONNECTION_PASSWORD: openbudgeteer
CONNECTION_DATABASE: openbudgeteer
run: dotnet test OpenBudgeteer.Core.Test
deploy-docker-app:
runs-on: ubuntu-latest
name: Build and Push Docker Image (App)
needs: test
if: success()
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Docker Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: axelander/openbudgeteer:pre-release
platforms: linux/arm64,linux/amd64
deploy-docker-api:
runs-on: ubuntu-latest
name: Build and Push Docker Image (API)
needs: test
if: success()
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Docker Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: axelander/openbudgeteer-api:pre-release
file: API.Dockerfile
platforms: linux/arm64,linux/amd64