-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
77 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters