Skip to content

Commit 868c855

Browse files
committed
OK-735: Build and deploy docker container
1 parent 8b22f82 commit 868c855

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,31 @@ jobs:
3939
run: |
4040
cd ovara-backend
4141
mvn clean package -B -DskipTests
42+
43+
deploy-container:
44+
needs: build
45+
runs-on: ubuntu-latest
46+
47+
steps:
48+
- uses: actions/checkout@v2
49+
50+
- name: Build and deploy Docker container
51+
shell: bash
52+
env:
53+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
54+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
55+
run: |
56+
set -euo pipefail
57+
git clone https://github.com/Opetushallitus/ci-tools.git
58+
source ci-tools/common/setup-tools.sh
59+
export ARTIFACT_NAME="ovara-backend"
60+
export BASE_IMAGE="baseimage-fatjar-openjdk21:master"
61+
source ci-tools/common/setup-tools.sh
62+
63+
pwd
64+
ls
65+
mv target/ovara-backend-*.jar $DOCKER_BUILD_DIR/artifact/${ARTIFACT_NAME}.jar
66+
cp -vr src/main/resources/application.properties $DOCKER_BUILD_DIR/config/
67+
./ci-tools/common/pull-image.sh
68+
./ci-tools/github-build/build-fatjar.sh $ARTIFACT_NAME
69+
./ci-tools/github-build/upload-image.sh $ARTIFACT_NAME

0 commit comments

Comments
 (0)