Skip to content

Commit

Permalink
Added docker build step to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yannis committed Aug 31, 2022
1 parent 655e6fd commit 5cf95b2
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 22 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Rokku-STS build

on: [ push ]

env:
DOCKER_REPO: wbaa/rokku-sts

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'sbt'
- name: Set version
run: |
ROKKU_STS_VERSION="${GITHUB_REF##*/}"
echo "ROKKU_STS_VERSION=${ROKKU_STS_VERSION}" >> $GITHUB_ENV
- name: Run docker-compose
run: docker-compose up -d && ./scripts/waitForContainerSetup.sh

- name: Run tests
run: sbt clean coverage test it:test coverageReport

- name: Build and publish docker image
run: |
if [ "$ROKKU_STS_VERSION" = "master" ]; then
echo $(git describe --tags --abbrev=0)
fi
# Login to docker
echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
# Build docker image
echo "Build image for with name $DOCKER_REPO:$ROKKU_STS_VERSION";
sbt clean docker:publish;

21 changes: 0 additions & 21 deletions .github/workflows/test.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fork := true

dockerExposedPorts := Seq(12345)
dockerCommands += ExecCmd("ENV", "PROXY_HOST", "0.0.0.0")
dockerBaseImage := "openjdk:8u171-jre-slim-buster"
dockerBaseImage := "openjdk:11-slim-buster"
dockerAlias := docker.DockerAlias(Some("docker.io"), Some("wbaa"), "rokku-sts", Some(rokkuStsVersion))

scalariformPreferences := scalariformPreferences.value
Expand Down

0 comments on commit 5cf95b2

Please sign in to comment.