-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (59 loc) · 1.92 KB
/
ktorbase.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
name: KtorBase
on:
push:
branches:
- '**'
schedule:
- cron: "0 1 * * *"
release:
types: [ published ]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-ktorbase-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-ktorbase-
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
- name: Gradle Build
run: ./gradlew build
- name: Extract Version
id: extract-version
run: |
VERSION="$(./gradlew cV | grep "Project version" | cut -d ":" -f2 | xargs)"
echo "Detected version: $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- 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: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Build and Push
uses: docker/build-push-action@v5
with:
context: .
load: ${{ github.event_name != 'release' }}
push: ${{ github.event_name == 'release' }}
tags: |
linkedplanet/ktorbase:latest
linkedplanet/ktorbase:${{ env.VERSION }}
- name: Start KtorBase
run: docker run -d -p 9090:9090 -e APPLICATION_SECRET=0000000000000000000000000000000 linkedplanet/ktorbase:latest
- name: Await Start-up
run: wget --tries 10 http://localhost:9090/health
- name: Run Integration Tests
run: ./gradlew integrationTest