-
Notifications
You must be signed in to change notification settings - Fork 10
111 lines (102 loc) · 3.63 KB
/
pipeline.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
name: Pipeline
on: [push]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core SDK 7
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Download katai struct compiler
run: |
wget https://github.com/kaitai-io/kaitai_struct_compiler/releases/download/0.9/kaitai-struct-compiler-0.9.zip
unzip kaitai-struct-compiler-0.9.zip
PATH="${PWD}/kaitai-struct-compiler-0.9/bin/:${PATH}"
sudo apt-get update && sudo apt-get install -y openjdk-8-jre
cd Executables/Game
sudo chmod +x generate_kaitai.sh
./generate_kaitai.sh
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
deploy:
needs:
- test
runs-on: ubuntu-latest
# only deploy if on master or tag
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- name: Login to Docker Registry
uses: docker/login-action@v2
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
# game
- name: Extract metadata (tags, labels) for Docker
id: meta-game
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/game
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=raw,latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
- name: Build and push game image
uses: docker/[email protected]
with:
context: .
file: Executables/Game/Dockerfile
push: true
tags: ${{ steps.meta-game.outputs.tags }}
labels: ${{ steps.meta-game.outputs.labels }}
# auth
- name: Extract metadata (tags, labels) for Docker
id: meta-auth
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/auth
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=raw,latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
- name: Build and push auth image
uses: docker/[email protected]
with:
context: .
images: ghcr.io/meikellp/quantum-core-x/auth
file: Executables/Auth/Dockerfile
push: true
tags: ${{ steps.meta-auth.outputs.tags }}
labels: ${{ steps.meta-auth.outputs.labels }}
# migrator
- name: Extract metadata (tags, labels) for Docker
id: meta-migrator
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/migrator
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=raw,latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
- name: Build and push migrator image
uses: docker/[email protected]
with:
context: .
images: ghcr.io/meikellp/quantum-core-x/migrator
file: Executables/Migrator/Dockerfile
push: true
tags: ${{ steps.meta-migrator.outputs.tags }}
labels: ${{ steps.meta-migrator.outputs.labels }}