Skip to content

Commit ca9cb23

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

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/build.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,30 @@ 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+
printf "HELLO\n"
63+
ls
64+
mv ovara-backend/target/ovara-backend-*.jar $DOCKER_BUILD_DIR/artifact/${ARTIFACT_NAME}.jar
65+
cp -vr src/main/resources/application.properties $DOCKER_BUILD_DIR/config/
66+
./ci-tools/common/pull-image.sh
67+
./ci-tools/github-build/build-fatjar.sh $ARTIFACT_NAME
68+
./ci-tools/github-build/upload-image.sh $ARTIFACT_NAME

0 commit comments

Comments
 (0)