diff --git a/.circleci/config.yml b/.circleci/config.yml index 524b75b..c6785be 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,9 +26,13 @@ jobs: path: ./build/libs/ prefix: libs + - run: + name: Copy libs to workspace + command: mkdir -p ./ws && cp -r ./build ./ws + - persist_to_workspace: - root: ./build/libs/ - paths: . + root: ./ws/ + paths: ./build/libs/ - save_cache: paths: @@ -48,13 +52,13 @@ jobs: - checkout - attach_workspace: - at: ./build/ + at: ./ws/ - run: name: "Publish Release on GitHub" command: | VERSION=$(git describe --tags) - ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} ./build/libs + ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} ./ws/build/libs publish-to-docker-hub: docker: @@ -64,7 +68,7 @@ jobs: - checkout - attach_workspace: - at: ./build/libs + at: ./ws/ - setup_remote_docker: docker_layer_caching: true @@ -73,6 +77,7 @@ jobs: name: Build and push docker image command: | VERSION=$(git describe --tags) + cp -r ./ws/build ./build docker build --tag desp/glickorater:${VERSION} . echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin docker push desp/glickorater:${VERSION}