Skip to content

Commit

Permalink
Merge cdce664 into 94745ac
Browse files Browse the repository at this point in the history
  • Loading branch information
wlodarcp authored May 21, 2021
2 parents 94745ac + cdce664 commit 9b0f5d1
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 48 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/java.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
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 Maven 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: Build with maven & generate reports
env:
COVERALLS_REPO_KEY: ${{ secrets.COVERALLS_REPO_KEY }}
run: mvn clean verify jacoco:report coveralls:report
- 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/main'
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: mvn validate docker:build@build-docker -P docker-app -f ./judge-d-server/pom.xml
- name: Push judge-d docker image to DockerHub
run: docker push 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
uses: akhileshns/heroku-deploy@v3.12.12
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: judge-d
- name: Build docker image for agent
run: mvn validate docker:build@build-docker -P docker-app -f ./judge-d-agent/pom.xml
- name: Publish judge-d-agent docker image to DockerHub
run: docker push hltech/judge-d-agent
47 changes: 0 additions & 47 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion judge-d-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<version>1.14.3</version>
<version>1.15.3</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down

0 comments on commit 9b0f5d1

Please sign in to comment.