-
Notifications
You must be signed in to change notification settings - Fork 5
106 lines (88 loc) · 2.48 KB
/
hub-gateway.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
name: Hub.Gateway
on:
push:
paths:
- "src/Worms.Hub.Gateway/**"
- "src/database/**"
- "build/docker/makefile"
- "build/docker/gateway/**"
- "build/release-github.sh"
- "build/version.sh"
- ".github/workflows/hub-gateway.yml"
jobs:
build:
name: Package - Gateway
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Package
run: |
make gateway.package
build-database:
name: Build - Database
runs-on: ubuntu-latest
env:
FLYWAY_LICENSE_KEY: ${{ secrets.FLYWAY_LICENSE_KEY }}
services:
postgres:
image: postgres
env:
POSTGRES_USER: worms
POSTGRES_PASSWORD: worms
POSTGRES_DB: worms
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test Flyway Migrations
uses: docker://redgate/flyway:9
with:
args: >-
-locations="filesystem:/github/workspace/src/database/migrations"
-configFiles="/github/workspace/src/database/flyway.conf"
-url="jdbc:postgresql://postgres:5432/worms"
-user="worms"
-password="worms"
-schemas="public"
info
migrate
info
release:
name: Release
runs-on: ubuntu-latest
needs: [build, build-database]
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: theeadie
password: ${{ secrets.DockerHubAccessToken }}
- name: Release
run: |
make gateway.release GITHUB_AUTH_TOKEN=${{ secrets.GITHUB_TOKEN }}