diff --git a/.github/deploy.sh b/.github/deploy.sh index 58848b5..8a92061 100755 --- a/.github/deploy.sh +++ b/.github/deploy.sh @@ -2,14 +2,18 @@ set -e set -o pipefail +# Deploy app sudo chmod -R 777 /github/ -pip install --user --upgrade pip==18.0 -pip install --user --no-cache-dir -r requirements.txt +sudo groupadd docker +sudo usermod -aG docker $USER +# pip install --user --upgrade pip==18.0 +# pip install --user --no-cache-dir -r requirements.txt +# echo ${DOCKER_LOGIN} +# echo ${DOCKER_PWD} ~/.local/bin/pyinstaller -F hello_world.py export TAG=${GITHUB_SHA} export IMAGE_NAME='python-cicd-workshop' -export DOCKER_LOGIN='ariv3ra' -export DOCKER_IMAGE_NAME=${DOCKER_LOGIN}/${IMAGE_NAME} +export DOCKER_IMAGE_NAME=ariv3ra/${IMAGE_NAME} docker build -t ${DOCKER_IMAGE_NAME} -t ${DOCKER_IMAGE_NAME}:${TAG} . echo ${DOCKER_PWD} | docker login -u ${DOCKER_LOGIN} --password-stdin docker push ${DOCKER_IMAGE_NAME} \ No newline at end of file diff --git a/.github/main.workflow b/.github/main.workflow index 13f7873..0b09537 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -8,8 +8,10 @@ action "build_test" { runs = "./.github/build_test.sh" } + action "deploy" { uses = "docker://circleci/python:2.7.15" runs = "./.github/deploy.sh" needs = "build_test" + secrets = ["DOCKER_LOGIN", "DOCKER_PWD"] }