Skip to content
send

GitHub Action

Bump docker image version on a remote host

v3 Latest version

Bump docker image version on a remote host

send

Bump docker image version on a remote host

A GitHub Action that deploys the newest version of an docker image on a remote server via ssh

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Bump docker image version on a remote host

uses: thematchless/bump-image-version-action@v3

Learn more about this action in thematchless/bump-image-version-action

Choose a version

Build and publish Docker image

Bump docker image version on a remote host

This repository contains an GitHub action to bump up a docker image version specified in your docker-compose stack.

Requirements for this GitHub Action to work

  • your remote server must be accessible via ssh and is reachable
  • you have a ssh private and public key to authenticate via ssh
  • you have saved your private and public key to the GitHub project secrets

Configuration options for the action

required key example default description
remote_docker_host thematchless@fancyServer.de username@host
ssh_private_key -----BEGIN OPENSSH PRIVATE KEY----
UgAAAAtzc2gtZWQyNTUxOQAAACALBUg
UgAAAAtzc2gtZWQyNTUxOQAAACALBUg
UgAAAAtzc2gtZWQyNTUxOQAAACALBUg
-----END OPENSSH PRIVATE KEY-----
private key in PEM format
ssh_public_key ssh-ed25519 ABCDABCDu027374972309 public key of the PEM
service_name super-fancy-react-app name of the service inside of the compose file
deploy_path /home/thematchless/stack-1 path which contains your compose file on the remote host
args up -d arguments how to start your service
stack_file_name docker-compose.yaml docker-compose.yml name of the compose file
remote_docker_port 1337 22 ssh port on the host
pull_images_first true false flag to force the image pull before starting

Example GitHub action task

- name: Deploy on Remote Server
  uses: thematchless/bump-image-version-action@v2
  with:
    remote_docker_host: thematchless@fancyServer.de
    ssh_private_key: ${{ secrets.REMOTE_SSH_PRIVATE_KEY }}
    ssh_public_key: ${{ secrets.REMOTE_SSH_PUBLIC_KEY }}
    service_name: super-fancy-react-app
    deploy_path: /home/thematchless/stack-1
    args: up -d
    pull_images_first: true

License

This project is licensed under the MIT license. See the LICENSE file for details.