-
Notifications
You must be signed in to change notification settings - Fork 4
80 lines (79 loc) · 3.13 KB
/
java.yaml
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
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Pull postgress docker image for functional tests
run: docker pull postgres:9.6.12
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with gradle & generate reports
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_KEY }}
run: ./gradlew clean check -i codeCoverageReport coveralls
- name: Cache build files
uses: actions/cache@v2
id: cache-build
with:
path: ./*
key: ${{ github.sha }}
release:
name: Release
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Retrieve files from cache
uses: actions/cache@v2
id: cache-build
with:
path: ./*
key: ${{ github.sha }}
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build judge-d-server docker image
run: ./gradlew judge-d-server:dockerTag
- name: Push judge-d docker image to DockerHub
run: docker push --all-tags hltech/judge-d
- name: Push to heroku registry
run: |
docker login -u _ -p $HEROKU_API_KEY registry.heroku.com
docker tag hltech/judge-d registry.heroku.com/judge-d/web
docker push registry.heroku.com/judge-d/web
env:
HEROKU_API_KEY: ${{secrets.HEROKU_API_KEY}}
- name: Release judge-d on Heroku
run: |
heroku container:login
heroku container:release web -a $HEROKU_APP_NAME
env:
HEROKU_API_KEY: ${{secrets.HEROKU_API_KEY}}
HEROKU_APP_NAME : "judge-d"
- name: Build docker image for agent
run: ./gradlew judge-d-agent:dockerTag
- name: Publish judge-d-agent docker image to DockerHub
run: docker push --all-tags hltech/judge-d-agent