Skip to content

A GitHub action that makes GitOps with the simplicity of Docker Compose possible.

License

Notifications You must be signed in to change notification settings

FarisZR/docker-compose-gitops-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Compose Gitops

A GitHub Action making GitOps with the simplicity of docker-compose possible, using SSH or optionally Tailscale SSH, with support for docker swarm, uploading directory for bind mounts and other features!

The Action is adapted from work by TapTap21 and wshihadeh

Example

Here is an example of how to use the action

- name: Tailscale
  uses: tailscale/github-action@ce41a99162202a647a4b24c30c558a567b926709
  with:
    authkey: ${{ secrets.TAILSCALE_AUTHKEY }}
    hostname: Github-actions

- name: Start Deployment
  uses: FarisZR/docker-compose-gitops-action@v1
  with:
    remote_docker_host: [email protected]
    tailscale_ssh: true # no need for manual private and public keys
    compose_file_path: postgres/docker-compose.yml
    upload_directory: true # upload docker directory
    docker_compose_directory: postgres # directory to upload
    docker_login_password: ${{ secrets.DOCKER_REPO_PASSWORD }}
    docker_login_user: ${{ secrets.DOCKER_REPO_USERNAME }}
    docker_login_registry : ${{ steps.login-ecr.outputs.registry }}
    args: -p postgres up -d

Action Inputs

  • args - Docker compose/stack command arguments. Example: -p app_stack_name -d up required
  • remote_docker_host Specify Remote Docker host. The input value must be in the following format (user@host) required
  • tailscale_ssh Enables Tailscale ssh mode, which uses managed ssh keys from Tailscale, and skips the private and public keys. default: false
  • ssh_public_key Remote Docker SSH public key. Required when Tailscale ssh isn't enabled
  • ssh_private_key SSH private key used in PEM format to connect to the docker host. Required when Tailscale ssh isn't enabled
  • ssh_port The SSH port to be used. Default is 22.
  • compose_file_path Docker compose file path. Default is docker-compose.yml(repo root), sub-directory Example: caddy/docker-compose.yml
  • upload_directory Uploads docker compose directory, useful for extra files like Configs. Optional
  • docker_compose_directory Specifies which directory in the repository to upload, needed for upload_directory
  • post_upload_command Optional input to execute a command post upload, when upload_directory is enabled. Useful for things like changing permissions before starting containers.
  • docker_swarm Uses docker swarm instead of compose by using the docker stack command, default: false
  • docker_login_user The username for the container repository user. (DockerHub, ECR, etc.). Optional.
  • docker_login_password The password for the container repository user.
  • docker_login_registry The docker container registry to authenticate against Optional

License

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

About

A GitHub action that makes GitOps with the simplicity of Docker Compose possible.

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Shell 97.0%
  • Dockerfile 3.0%