From f1084e16037a2cd39df22eb9c7f68f3485661b2f Mon Sep 17 00:00:00 2001 From: Bernhard Bliem Date: Fri, 11 Oct 2024 16:37:38 +0200 Subject: [PATCH] Set up CI job for deployment with dokku For now, this is only done when pushing to `deployment/production` and the GitHub Actions variable `DOKKU_DEPLOY_PRODUCTION_GIT_URL` is set. --- .github/workflows/ci.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4dd8403d..490c1394 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -37,3 +37,20 @@ jobs: project_id: watch-ui build_id: ${{ needs.build.outputs.build_id }} deployment_env: ${{ needs.build.outputs.deployment_env }} + + dokku-deploy: + needs: [build, deploy] + # FIXME: Should be configurable + if: needs.build.outputs.deployment_env == 'production' && vars.DOKKU_DEPLOY_PRODUCTION_GIT_URL != '' + runs-on: runner-prod + container: + image: dokku/ci-docker-image:latest + steps: + - name: Push to dokku + run: dokku-deploy + env: + GIT_REMOTE_URL: ${{ vars.DOKKU_DEPLOY_PRODUCTION_GIT_URL }} + SSH_PRIVATE_KEY: ${{ secrets.DOKKU_SSH_PRIVATE_KEY }} + DEPLOY_DOCKER_IMAGE: ${{ needs.build.outputs.image }}:${{ needs.build.outputs.image_tag }} + # For debugging + # TRACE: '1'