diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 116383ddc304417ccf6036ae0f922f41038aac50..17f294d09b3eed22eeb48b6dc10a8490e58e6f64 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -140,4 +140,40 @@ deploy backend: - backend/**/* - .gitlab-ci.yml refs: - - main \ No newline at end of file + - main + +build web frontend: + stage: build + image: gradle:7.1 + script: + - cd mosogepsch + - ./gradlew jsBrowserProductionWebpack + artifacts: + paths: + - mosogepsch/build/distributions + only: + changes: + - mosogepsch/**/* + - .gitlab-ci.yml + + +deploy web frontend: + stage: deploy + image: kroniak/ssh-client + before_script: + - eval $(ssh-agent -s) + - echo "$SSH" | tr -d '\r' | ssh-add - + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - 'echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + needs: + - build web frontend + script: + - scp mosogepsch/build/distributions/* $MOSOGEPSCH_HOST:/opt/mosogepsch/frontend + only: + changes: + - mosogepsch/**/* + - .gitlab-ci.yml + refs: + - main +