-
Notifications
You must be signed in to change notification settings - Fork 5
93 lines (84 loc) · 2.55 KB
/
Copy pathapi-worker.yml
File metadata and controls
93 lines (84 loc) · 2.55 KB
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
name: API Worker Build & Deploy
concurrency: api-worker
# Deploys every push to main like the api-server does: it is the other half of the same port, and
# a jar build is cheap enough that there is no reason to wait for a tag.
on:
push:
branches: [ main ]
paths:
- 'bin/api-worker/**'
- 'modules/**'
- 'tools/ipc-gen/**'
- 'tools/sql-gen/**'
- '.github/workflows/api-worker.yml'
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/setup-java@v5
with:
java-version: '25'
distribution: 'graalvm'
cache: 'gradle'
- name: Test
run: ./gradlew :modules:api:checkFormat :bin:api-worker:checkFormat :modules:api:sqlGenCheck :modules:api:test :bin:api-worker:test --no-daemon
docker-build:
needs: [ test ]
runs-on: ubuntu-latest
steps:
- name: Import Secrets
uses: hollow-cube/actions/secrets@main
with:
token: ${{ secrets.VAULT_TOKEN }}
path: global/github
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/setup-java@v5
with:
java-version: '25'
distribution: 'graalvm'
cache: 'gradle'
- name: Build jar
run: ./gradlew :bin:api-worker:shadowJar --no-daemon
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: mworzala
password: ${{ env.DOCKER_PASS }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: "bin/api-worker/deploy/Dockerfile"
platforms: linux/amd64
push: true
tags: mworzala/api-worker:${{ github.sha }}
helm-build:
needs: [ docker-build ]
runs-on: ubuntu-latest
steps:
- name: Helm build
uses: hollow-cube/actions/helm-build@main
with:
vault-token: ${{ secrets.VAULT_TOKEN }}
name: api-worker
path: "bin/api-worker/deploy/helm-chart"
helm-deploy:
name: Deploy API Worker
needs: [ docker-build, helm-build ]
runs-on: ubuntu-latest
steps:
- name: Helm deploy
uses: hollow-cube/actions/helm-deploy@main
with:
vault-token: ${{ secrets.VAULT_TOKEN }}
name: api-worker
cluster: prod-v3
values: "bin/api-worker/deploy/values-prod.yaml"