1
+ name : Continuous deployment in dev
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - development
7
+
8
+ jobs :
9
+ check :
10
+ runs-on : ubuntu-latest
11
+ container : " openjdk:11-slim"
12
+ steps :
13
+ - uses : actions/checkout@v2
14
+ - uses : actions/cache@v1
15
+ with :
16
+ path : ~/.gradle/caches
17
+ key : ${{ runner.os }}-patio-api-gradle-${{ hashFiles('**/*.gradle') }}
18
+ restore-keys : |
19
+ ${{ runner.os }}-patio-api-gradle-
20
+ - uses : actions/cache@v1
21
+ with :
22
+ path : ~/.gradle/wrapper
23
+ key : ${{ runner.os }}-patio-api-wrapper-${{ hashFiles('**/*.gradle') }}
24
+ restore-keys : |
25
+ ${{ runner.os }}-patio-api-wrapper-
26
+ - name : Tests
27
+ run : ./gradlew test
28
+ - name : PMD (src/main)
29
+ run : ./gradlew pmdMain
30
+ - name : PMD (src/test)
31
+ run : ./gradlew pmdTest
32
+ - name : Files have the license header
33
+ run : ./gradlew license
34
+ - name : Formatter (Spotless)
35
+ run : ./gradlew spotlessCheck
36
+ - name : Spotbugs (Main)
37
+ run : ./gradlew spotbugsMain
38
+ - name : Spotbugs (Test)
39
+ run : ./gradlew spotbugsTest
40
+
41
+ docker :
42
+ needs : check
43
+ runs-on : ubuntu-latest
44
+ container : " openjdk:11-slim"
45
+ steps :
46
+ - uses : actions/checkout@v2
47
+ - name : Publish latest image to Docker Hub
48
+ env :
49
+ REGISTRY_KEY : ${{ secrets.REGISTRY_KEY }}
50
+ REGISTRY_USER : ${{ secrets.REGISTRY_USER }}
51
+ run : ./gradlew --stacktrace dockerPush -PregistryUser=$REGISTRY_USER -PregistryKey=$REGISTRY_KEY
52
+
53
+ deploy :
54
+ needs : docker
55
+ runs-on : ubuntu-latest
56
+ steps :
57
+ - name : Deploy to K8s (dev)
58
+ uses : steebchen/kubectl@master
59
+ env :
60
+ KUBE_CONFIG_DATA : ${{ secrets.KUBE_CONFIG_DATA }}
61
+ with :
62
+ args : set image deployment/patio-api patio-api=kaleidosteam/patio-api
63
+ - name : verify API deployment
64
+ uses : steebchen/kubectl@master
65
+ env :
66
+ KUBE_CONFIG_DATA : ${{ secrets.KUBE_CONFIG_DATA }}
67
+ KUBECTL_VERSION : " 1.15"
68
+ with :
69
+ args : rollout restart deployment/patio-api
70
+ - name : Make front be aware of API changes (Hack)
71
+ uses : steebchen/kubectl@master
72
+ env :
73
+ KUBE_CONFIG_DATA : ${{ secrets.KUBE_CONFIG_DATA }}
74
+ KUBECTL_VERSION : " 1.15"
75
+ with :
76
+ args : rollout restart deployment/patio-front
0 commit comments