├── .github ├── dependabot.yaml ├── linters │ ├── .markdown-lint.yaml │ └── .yamllint.yaml └── workflows │ ├── build.yaml │ └── lint.yaml ├── Dockerfile ├── LICENSE ├── README.md ├── action.yaml └── example-workflows ├── build-and-deploy.yaml ├── cancel-previous-runs.yaml ├── custom-deploy-branch.yaml ├── force-push.yaml ├── review-app.yaml ├── review-app └── ci-pre-deploy ├── simple.yaml ├── specify-ssh-host-key.yaml └── verbose-logging.yaml /.github/dependabot.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 2 3 | updates: 4 | - package-ecosystem: "docker" 5 | directory: "/" 6 | schedule: 7 | interval: "daily" 8 | - package-ecosystem: "github-actions" 9 | directory: "/" 10 | schedule: 11 | interval: daily 12 | open-pull-requests-limit: 10 13 | - package-ecosystem: "github-actions" 14 | directory: "/example-workflows" 15 | schedule: 16 | interval: daily 17 | open-pull-requests-limit: 10 18 | -------------------------------------------------------------------------------- /.github/linters/.markdown-lint.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | default: true 3 | 4 | # Line length 5 | # https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md013 6 | MD013: false 7 | -------------------------------------------------------------------------------- /.github/linters/.yamllint.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: default 3 | 4 | rules: 5 | line-length: disable 6 | -------------------------------------------------------------------------------- /.github/workflows/build.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: build 3 | 4 | # yamllint disable-line rule:truthy 5 | on: 6 | pull_request: 7 | branches: 8 | - '*' 9 | push: 10 | branches: 11 | - 'master' 12 | jobs: 13 | docker: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout 17 | uses: actions/checkout@v4 18 | 19 | - name: Docker meta 20 | id: meta 21 | uses: docker/metadata-action@v5 22 | with: 23 | images: | 24 | dokku/github-action 25 | tags: | 26 | type=semver,pattern={{version}} 27 | type=semver,pattern={{major}}.{{minor}} 28 | type=semver,pattern={{major}} 29 | type=sha 30 | 31 | - name: Set up QEMU 32 | uses: docker/setup-qemu-action@v3 33 | - name: Set up Docker Buildx 34 | uses: docker/setup-buildx-action@v3 35 | 36 | - name: Login to DockerHub 37 | if: ${{ github.event_name != 'pull_request' }} 38 | uses: docker/login-action@v3 39 | with: 40 | username: ${{ secrets.DOCKERHUB_USERNAME }} 41 | password: ${{ secrets.DOCKERHUB_TOKEN }} 42 | 43 | - name: Build and push 44 | uses: docker/build-push-action@v6 45 | with: 46 | context: . 47 | platforms: linux/amd64,linux/arm64 48 | push: false 49 | tags: ${{ steps.meta.outputs.tags }} 50 | labels: ${{ steps.meta.outputs.labels }} 51 | -------------------------------------------------------------------------------- /.github/workflows/lint.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "lint" 3 | 4 | # yamllint disable-line rule:truthy 5 | on: 6 | pull_request: 7 | branches: 8 | - "*" 9 | push: 10 | branches: 11 | - "master" 12 | 13 | jobs: 14 | hadolint: 15 | name: hadolint 16 | runs-on: ubuntu-24.04 17 | steps: 18 | - name: Clone 19 | uses: actions/checkout@v4 20 | - name: Run hadolint 21 | uses: brpaz/hadolint-action@c27bd9edc1e95eed30474db8f295ff5807ebca14 22 | # v1.1.0 => eb9b96be611b84830aa1babacfb7070ecd2a8b1b 23 | 24 | markdown-lint: 25 | name: markdown-lint 26 | runs-on: ubuntu-24.04 27 | steps: 28 | - name: Clone 29 | uses: actions/checkout@v4 30 | - name: Run markdown-lint 31 | uses: avto-dev/markdown-lint@04d43ee9191307b50935a753da3b775ab695eceb 32 | # v1.4.0 => 6e6d4393411fbaae3c3aeee5661ba84a0352ed3b 33 | with: 34 | config: ".github/linters/.markdown-lint.yaml" 35 | args: "./README.md" 36 | 37 | yamllint: 38 | name: yamllint 39 | runs-on: ubuntu-24.04 40 | steps: 41 | - name: Clone 42 | uses: actions/checkout@v4 43 | - name: Run yamllint 44 | uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c 45 | # v3.0.0 => b2aeacc1b7eeb8c23e84bba320d04fb5d6a323ee 46 | with: 47 | config_file: ".github/linters/.yamllint.yaml" 48 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM dokku/ci-docker-image:0.15.0 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Olivier Brassard 4 | Copyright (c) 2020 Jose Diaz-Gonzalez 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dokku github-action 2 | 3 | Official Github Action for deploying apps to a Dokku installation 4 | 5 | ## Requirements 6 | 7 | Please note that this action is compatible with `dokku >= 0.11.6`. 8 | 9 | ## Inputs 10 | 11 | - `branch`: (_optional_) The branch to deploy when pushing to Dokku. Useful when a [custom deploy branch](https://dokku.com/docs/deployment/methods/git/#changing-the-deploy-branch) is set on Dokku. 12 | - default: `master` 13 | - example value: `main` 14 | - `ci_branch_name`: (_optional_) The branch name that triggered the deploy. Automatically detected from `GITHUB_REF`. 15 | - example value: `develop` 16 | - `ci_commit`: (_optional_) The commit sha that will be pushed. Automatically detected from `GITHUB_SHA`. 17 | - example value: `0aa00d8dd7c971c121e3d1e471d0a35e1daf8abe` 18 | - `command`: (_optional_) The command to run for the action. 19 | - default: `deploy` 20 | - valid values: 21 | - `deploy` 22 | - `review-apps:create`: Used to create a review app - via `dokku apps:clone` - based on the `appname` configured in the `git_remote_url`. If the review app already exists, this action will not recreate the app. In both cases, the current commit will be pushed to the review app. 23 | - `review-apps:destroy`: Destroys an existing review app. 24 | - `deploy_docker_image`: (_optional_) A docker image to deploy via `git:from-image`. 25 | - example value: `dokku/test-app:1` 26 | - `deploy_user_name`: (_optional_) A username to use when deploying a docker image 27 | - `deploy_user_email`: (_optional_) The email to use when deploying a docker image. 28 | - `git_push_flags`: (_optional_) A string containing a set of flags to set on push. This may be used to enable force pushes, or trigger verbose log output from git. 29 | - example value: `--force -vvv` 30 | - `git_remote_url`: (**required**) The dokku app's git repository url in SSH format. 31 | - example value: `ssh://dokku@dokku.myhost.ca:22/appname` 32 | - `review_app_name`: (_optional_) The name of the review app to create or destroy. Computed as `review-$APPNAME-$BRANCH_NAME` if not specified, where: 33 | 34 | ```text 35 | $APPNAME: The parsed app name from the `git_remote_url` 36 | $BRANCH_NAME: The inflected git branch name 37 | ``` 38 | 39 | - example value: `review-appname` 40 | - `ssh_host_key`: (_optional_) The results of running `ssh-keyscan -t rsa $HOST`. The github-action will otherwise generate this on the fly via `ssh-keyscan`. 41 | - example value: 42 | 43 | ```text 44 | # dokku.com:22 SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.1 45 | dokku.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCvS+lK38EEMdHGb... 46 | ``` 47 | 48 | - `ssh_private_key`: (**required**) A private ssh key that has push access to the Dokku instance. 49 | - tip: It is recommended to use [Encrypted Secrets](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets) to store sensitive information such as SSH Keys. 50 | - example value: 51 | 52 | ```text 53 | -----BEGIN OPENSSH PRIVATE KEY----- 54 | MIIEogIBAAKCAQEAjLdCs9kQkimyfOSa8IfXf4gmexWWv6o/IcjmfC6YD9LEC4He 55 | qPPZtAKoonmd86k8jbrSbNZ/4OBelbYO0pmED90xyFRLlzLr/99ZcBtilQ33MNAh 56 | ... 57 | SvhOFcCPizxFeuuJGYQhNlxVBWPj1Jl6ni6rBoHmbBhZCPCnhmenlBPVJcnUczyy 58 | zrrvVLniH+UTjreQkhbFVqLPnL44+LIo30/oQJPISLxMYmZnuwudPN6O6ubyb8MK 59 | -----END OPENSSH PRIVATE KEY----- 60 | ``` 61 | 62 | - `ssh_passphrase`: (_optional_) Passphrase to use when interacting with an SSH key that has a passphrase 63 | - example value: `password` 64 | 65 | - `trace`: (_optional_) Allows users to debug what the action is performing by enabling shell trace mode 66 | - example value: `1` 67 | 68 | ## Examples 69 | 70 | All examples below are functionally complete and can be copy-pasted into a `.github/workflows/deploy.yaml` file, with some minor caveats: 71 | 72 | - The `git_remote_url` should be changed to match the server and app. 73 | - An [Encrypted Secret](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets) should be set on the Github repository with the name `SSH_PRIVATE_KEY` containing the contents of a private ssh key that has been added to the Dokku installation via the `dokku ssh-keys:add` command. 74 | - As pushing a git repository from a shallow clone does not work, all repository checkous should use a `fetch-depth` of `0`. All examples below have this option set correctly. 75 | 76 | For simplicity, each example is standalone, but may be combined as necessary to create the desired effect. 77 | 78 | - [Simple Example](/example-workflows/simple.yaml): Deploys a codebase on push or merge to master. 79 | - [Build in CI and Deploy an image](/example-workflows/build-and-deploy.yaml): Builds a docker image in CI, pushes the image to the remote Docker Hub repository, and then notifies Dokku to deploy the built image. 80 | - [Cancel previous runs on new push](/example-workflows/cancel-previous-runs.yaml): This workflow is particularly useful when triggered by new pushes, and utilizes a third-party action. 81 | - [Avoid SSH Host Keyscan](/example-workflows/specify-ssh-host-key.yaml): By default, this action will scan the host for it's SSH host key and use that value directly. This may not be desirable for security compliance reasons. 82 | 83 | The `SSH_HOST_KEY` value can be retrieved by calling `ssh-keyscan -t rsa $HOST`, where `$HOST` is the Dokku server's hostname. 84 | - [Specify a custom deploy branch](/example-workflows/custom-deploy-branch.yaml): Certain Dokku installations may use custom deploy branches other than `master`. In the following example, we push to the `develop` branch. 85 | - [Verbose Push Logging](/example-workflows/verbose-logging.yaml): Verbose client-side logging may be enabled with this method, as well as trace mode for all shell command output. Note that this does not enable trace mode on the remote deploy, and simply tells the `git` client to enable verbose log output. 86 | - [Force Pushing](/example-workflows/force-push.yaml): If the remote app has been previously pushed manually from a location other than CI, it may be necessary to enable force pushing to avoid git errors. 87 | - [Review Apps](/example-workflows/review-app.yaml): Handles creation and deletion of review apps through use of `dokku apps:clone` and `dokku apps:destroy`. Review apps are a great way to allow folks to preview pull request changes before they get merged to production. 88 | - Placing a shell script at `bin/ci-pre-deploy` can be used to reconfigure the app, as shown in [this example](/example-workflows/review-app/ci-pre-deploy). 89 | -------------------------------------------------------------------------------- /action.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Dokku" 3 | description: "Official Github Action for deploying apps to a Dokku installation" 4 | author: "Dokku" 5 | branding: 6 | icon: "upload-cloud" 7 | color: "blue" 8 | inputs: 9 | branch: 10 | description: "The branch to deploy when pushing to Dokku (default: master)" 11 | required: false 12 | default: "master" 13 | ci_branch_name: 14 | description: "The command to run for the action (default: detected from GITHUB_REF)" 15 | required: false 16 | default: "" 17 | ci_commit: 18 | description: "The commit sha that will be pushed (default: detected from GITHUB_SHA)" 19 | required: false 20 | default: "" 21 | command: 22 | description: "The command to run for the action (default: deploy)" 23 | required: false 24 | default: "deploy" 25 | deploy_docker_image: 26 | description: "A docker image to deploy via `git:from-image`" 27 | required: false 28 | default: "" 29 | deploy_user_name: 30 | description: "A username to use when deploying a docker image" 31 | required: false 32 | default: "" 33 | deploy_user_email: 34 | description: "The email to use when deploying a docker image" 35 | required: false 36 | default: "" 37 | git_push_flags: 38 | description: "A string containing a set of flags to set on push" 39 | required: false 40 | default: "" 41 | git_remote_url: 42 | description: "The dokku app's git repository url (in SSH format)" 43 | required: true 44 | review_app_name: 45 | description: "The name of the review app to create or destroy" 46 | required: false 47 | default: "" 48 | ssh_host_key: 49 | description: "The results of running `ssh-keyscan -t rsa $HOST`" 50 | required: false 51 | default: "" 52 | ssh_private_key: 53 | description: "A private SSH key that has push access to your Dokku instance" 54 | required: true 55 | ssh_passphrase: 56 | description: "Passphrase to use when interacting with an SSH key that has a passphrase" 57 | required: false 58 | default: "" 59 | trace: 60 | description: "Allows users to debug what the action is performing by enabling shell trace mode" 61 | required: false 62 | default: "" 63 | runs: 64 | using: "docker" 65 | image: "Dockerfile" 66 | entrypoint: "/bin/dokku-deploy" 67 | post-entrypoint: "/bin/dokku-unlock" 68 | post-if: cancelled() 69 | env: 70 | BRANCH: ${{ inputs.branch }} 71 | CI_BRANCH_NAME: ${{ inputs.ci_branch_name }} 72 | CI_COMMIT: ${{ inputs.ci_commit }} 73 | COMMAND: ${{ inputs.command }} 74 | DEPLOY_DOCKER_IMAGE: ${{ inputs.deploy_docker_image }} 75 | DEPLOY_USER_NAME: ${{ inputs.deploy_user_name }} 76 | DEPLOY_USER_EMAIL: ${{ inputs.deploy_user_email }} 77 | GIT_PUSH_FLAGS: ${{ inputs.git_push_flags }} 78 | GIT_REMOTE_URL: ${{ inputs.git_remote_url }} 79 | REVIEW_APP_NAME: ${{ inputs.review_app_name }} 80 | SSH_HOST_KEY: ${{ inputs.ssh_host_key }} 81 | SSH_PRIVATE_KEY: ${{ inputs.ssh_private_key }} 82 | SSH_PASSPHRASE: ${{ inputs.ssh_passphrase }} 83 | TRACE: ${{ inputs.trace }} 84 | -------------------------------------------------------------------------------- /example-workflows/build-and-deploy.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: 'deploy' 3 | 4 | # yamllint disable-line rule:truthy 5 | on: 6 | push: 7 | branches: 8 | - master 9 | 10 | jobs: 11 | deploy: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Cloning repo 15 | uses: actions/checkout@v4 16 | with: 17 | fetch-depth: 0 18 | 19 | - name: Set up qemu 20 | uses: docker/setup-qemu-action@v3 21 | 22 | - name: Set up docker buildx 23 | uses: docker/setup-buildx-action@v3 24 | 25 | - name: Login to docker hub 26 | uses: docker/login-action@v3 27 | with: 28 | username: ${{ secrets.DOCKERHUB_USERNAME }} 29 | password: ${{ secrets.DOCKERHUB_TOKEN }} 30 | 31 | - name: Build and push 32 | uses: docker/build-push-action@v6 33 | with: 34 | push: true 35 | tags: ${{ github.repository }}:${{ github.sha }} 36 | 37 | - name: Push to dokku 38 | uses: dokku/github-action@master 39 | with: 40 | git_remote_url: 'ssh://dokku@dokku.me:22/appname' 41 | ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} 42 | deploy_docker_image: ${{ github.repository }}:${{ github.sha }} 43 | -------------------------------------------------------------------------------- /example-workflows/cancel-previous-runs.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: 'deploy' 3 | 4 | # yamllint disable-line rule:truthy 5 | on: 6 | push: 7 | branches: 8 | - master 9 | 10 | jobs: 11 | deploy: 12 | runs-on: ubuntu-latest 13 | steps: 14 | # third-party action that cancels previous runs 15 | - name: Cancel Previous Runs 16 | uses: styfle/cancel-workflow-action@0.12.1 17 | with: 18 | access_token: ${{ github.token }} 19 | 20 | - name: Cloning repo 21 | uses: actions/checkout@v4 22 | with: 23 | fetch-depth: 0 24 | 25 | - name: Push to dokku 26 | uses: dokku/github-action@master 27 | with: 28 | git_remote_url: 'ssh://dokku@dokku.me:22/appname' 29 | ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} 30 | -------------------------------------------------------------------------------- /example-workflows/custom-deploy-branch.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: 'deploy' 3 | 4 | # yamllint disable-line rule:truthy 5 | on: 6 | push: 7 | branches: 8 | - master 9 | 10 | jobs: 11 | deploy: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Cloning repo 15 | uses: actions/checkout@v4 16 | with: 17 | fetch-depth: 0 18 | 19 | - name: Push to dokku 20 | uses: dokku/github-action@master 21 | with: 22 | # specify the `main` branch as the remote branch to push to 23 | branch: 'main' 24 | git_remote_url: 'ssh://dokku@dokku.me:22/appname' 25 | ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} 26 | -------------------------------------------------------------------------------- /example-workflows/force-push.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: 'deploy' 3 | 4 | # yamllint disable-line rule:truthy 5 | on: 6 | push: 7 | branches: 8 | - master 9 | 10 | jobs: 11 | deploy: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Cloning repo 15 | uses: actions/checkout@v4 16 | with: 17 | fetch-depth: 0 18 | 19 | - name: Push to dokku 20 | uses: dokku/github-action@master 21 | with: 22 | # specify `--force` as a flag for git pushes 23 | git_push_flags: '--force' 24 | git_remote_url: 'ssh://dokku@dokku.me:22/appname' 25 | ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} 26 | -------------------------------------------------------------------------------- /example-workflows/review-app.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: 'deploy' 3 | 4 | # yamllint disable-line rule:truthy 5 | on: 6 | # onl run this workflow on pull request events 7 | pull_request 8 | 9 | jobs: 10 | create_review_app: 11 | runs-on: ubuntu-latest 12 | # only run when a pull request is opened 13 | if: github.event_name == 'pull_request' && github.event.action == 'opened' 14 | steps: 15 | - name: Cloning repo 16 | uses: actions/checkout@v4 17 | with: 18 | fetch-depth: 0 19 | 20 | - name: Create and push the review app 21 | uses: dokku/github-action@master 22 | with: 23 | # create a review app 24 | command: review-apps:create 25 | git_remote_url: 'ssh://dokku@dokku.me:22/appname' 26 | # specify a name for the review app 27 | review_app_name: review-appname-${{ github.event.pull_request.number }} 28 | ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} 29 | 30 | 31 | deploy_review_app: 32 | runs-on: ubuntu-latest 33 | # only run when a pull request is not opened or closed 34 | if: github.event_name == 'pull_request' && github.event.action != 'opened' && github.event.action != 'closed' 35 | steps: 36 | - name: Cloning repo 37 | uses: actions/checkout@v4 38 | with: 39 | fetch-depth: 0 40 | 41 | - name: Push to dokku 42 | uses: dokku/github-action@master 43 | with: 44 | # create a review app 45 | git_remote_url: 'ssh://dokku@dokku.me:22/appname' 46 | # specify a name for the review app 47 | review_app_name: review-appname-${{ github.event.pull_request.number }} 48 | ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} 49 | 50 | destroy_review_app: 51 | runs-on: ubuntu-latest 52 | # only run when a pull request is closed 53 | if: github.event_name == 'pull_request' && github.event.action == 'closed' 54 | steps: 55 | - name: Destroy the review app 56 | uses: dokku/github-action@master 57 | with: 58 | # destroy a review app 59 | command: review-apps:destroy 60 | git_remote_url: 'ssh://dokku@dokku.me:22/appname' 61 | # specify a name for the review app 62 | review_app_name: review-appname-${{ github.event.pull_request.number }} 63 | ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} 64 | -------------------------------------------------------------------------------- /example-workflows/review-app/ci-pre-deploy: -------------------------------------------------------------------------------- 1 | #!/bin/sh -l 2 | if [ "$IS_REVIEW_APP" = "true" ]; then 3 | ssh "$SSH_REMOTE" -- config:set "$APP_NAME" "DOMAIN=$APP_NAME.dokku.me" 4 | echo "configured the review app domain" 5 | fi 6 | -------------------------------------------------------------------------------- /example-workflows/simple.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: 'deploy' 3 | 4 | # yamllint disable-line rule:truthy 5 | on: 6 | push: 7 | branches: 8 | - master 9 | 10 | jobs: 11 | deploy: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Cloning repo 15 | uses: actions/checkout@v4 16 | with: 17 | fetch-depth: 0 18 | 19 | - name: Push to dokku 20 | uses: dokku/github-action@master 21 | with: 22 | git_remote_url: 'ssh://dokku@dokku.me:22/appname' 23 | ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} 24 | -------------------------------------------------------------------------------- /example-workflows/specify-ssh-host-key.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: 'deploy' 3 | 4 | # yamllint disable-line rule:truthy 5 | on: 6 | push: 7 | branches: 8 | - master 9 | 10 | jobs: 11 | deploy: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Cloning repo 15 | uses: actions/checkout@v4 16 | with: 17 | fetch-depth: 0 18 | 19 | - name: Push to dokku 20 | uses: dokku/github-action@master 21 | with: 22 | git_remote_url: 'ssh://dokku@dokku.me:22/appname' 23 | # specify an alternative ssh host key 24 | ssh_host_key: ${{ secrets.SSH_HOST_KEY }} 25 | ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} 26 | -------------------------------------------------------------------------------- /example-workflows/verbose-logging.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: 'deploy' 3 | 4 | # yamllint disable-line rule:truthy 5 | on: 6 | push: 7 | branches: 8 | - master 9 | 10 | jobs: 11 | deploy: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Cloning repo 15 | uses: actions/checkout@v4 16 | with: 17 | fetch-depth: 0 18 | 19 | - name: Push to dokku 20 | uses: dokku/github-action@master 21 | # enable verbose ssh output 22 | env: 23 | GIT_SSH_COMMAND: 'ssh -vvv' 24 | with: 25 | # enable verbose git output 26 | git_push_flags: '-vvv' 27 | git_remote_url: 'ssh://dokku@dokku.me:22/appname' 28 | ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} 29 | # enable shell trace mode 30 | trace: '1' 31 | --------------------------------------------------------------------------------