diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c581e71..0707db72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,8 +27,8 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - run: cp .env.example .env - - run: ./run docker:build-images - - run: ./run docker:push-images + - run: ./run ci:build-images + - run: ./run ci:push-images - name: Add the deployment SSH key uses: shimataro/ssh-key-action@6f350ca8484d8d55c2e361e74d17e638dabe713a # 2.1.0 diff --git a/run b/run index 4f404d13..ba8b7dbc 100755 --- a/run +++ b/run @@ -13,6 +13,19 @@ fi DC="${DC:-exec}" +function ci:build-images { + docker image build . \ + --file tools/docker/images/Dockerfile \ + --tag ${DOCKER_WEB_IMAGE_NAME}:${DOCKER_TAG} \ + --tag ${DOCKER_WEB_IMAGE_NAME}:latest \ + --target=production +} + +function ci:push-images { + docker image push ${DOCKER_WEB_IMAGE_NAME}:${DOCKER_TAG} + docker image push ${DOCKER_WEB_IMAGE_NAME}:latest +} + function cmd { # Run any command in the app container. _dc app "${@}" @@ -27,19 +40,6 @@ function deploy { cd tools/deployment && ansible-playbook deploy.yml } -function docker:build-images { - docker image build . \ - --file tools/docker/images/Dockerfile \ - --tag ${DOCKER_WEB_IMAGE_NAME}:${DOCKER_TAG} \ - --tag ${DOCKER_WEB_IMAGE_NAME}:latest \ - --target=production -} - -function docker:push-images { - docker image push ${DOCKER_WEB_IMAGE_NAME}:${DOCKER_TAG} - docker image push ${DOCKER_WEB_IMAGE_NAME}:latest -} - function help { printf "%s [args]\n\nTasks:\n" "${0}"