Skip to content

Commit

Permalink
Add github actions workflow. Update docker-compose for new images.
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackEgoist committed Mar 23, 2022
1 parent da77f66 commit b567917
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
target: /var/lib/postgresql/data
restart: always
file-storage:
image: verapdf/file-storage:latest
image: ghcr.io/verapdf/verapdf_file-storage:latest
expose:
- 8080
depends_on:
Expand Down Expand Up @@ -47,7 +47,7 @@ services:
restart: always

job-service:
image: verapdf/job-service:latest
image: ghcr.io/verapdf/verapdf_job-service:latest
expose:
- 8080
depends_on:
Expand Down Expand Up @@ -86,7 +86,7 @@ services:
target: /var/lib/rabbitmq/

worker:
image: verapdf/worker:latest
image: ghcr.io/verapdf/verapdf_worker:latest
restart: always
depends_on:
- job-service
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build with maven, create docker images and push to github registries.

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '30 6,18 * * *'
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
WORKER_IMAGE_NAME: verapdf_worker
FILE_STORAGE_IMAGE_NAME: verapdf_file-storage
JOB_SERVICE_IMAGE_NAME: verapdf_job-service


jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up JDK 1.11
uses: actions/setup-java@v1
with:
java-version: 1.11

- name: Update gut submodule for veraPDF-validation-profiles
run: git submodule update --init --recursive

- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Build file-storage-service Docker image
run: docker build ./local-storage-service/server -f "./local-storage-service/server/Dockerfile-dev" -t $REGISTRY/verapdf/$FILE_STORAGE_IMAGE_NAME:latest

- name: Build job-service Docker image
run: docker build ./job-service/server -f "./job-service/server/Dockerfile-dev" -t $REGISTRY/verapdf/$JOB_SERVICE_IMAGE_NAME:latest

- name: Build worker-service Docker image
run: docker build ./worker -f "./worker/Dockerfile-dev" -t $REGISTRY/verapdf/$WORKER_IMAGE_NAME:latest

- name: Login into ${{ env.REGISTRY }}
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push file-storage-service Docker images to the ${{ env.REGISTRY }}
run : docker push $REGISTRY/verapdf/$FILE_STORAGE_IMAGE_NAME:latest

- name: Push job-service Docker images to the ${{ env.REGISTRY }}
run: docker push $REGISTRY/verapdf/$JOB_SERVICE_IMAGE_NAME:latest

- name: Push worker Docker images to the ${{ env.REGISTRY }}
run: docker push $REGISTRY/verapdf/$WORKER_IMAGE_NAME:latest

1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
path = worker/src/main/resources/profiles/veraPDF-validation-profiles
url = https://github.com/veraPDF/veraPDF-validation-profiles.git
branch = integration
update = rebase

0 comments on commit b567917

Please sign in to comment.