GitHub Action
Docker Stack Deploy Action
GitHub Action and Docker image used to deploy a Docker stack on a Docker Swarm.
When using private images, specify which registry to login to. If no value is provided, we fallback to Docker Hub.
To use GitHub Container registry, set the value to ghcr.io.
When using private images, specify username to be used to log in.
When using private images, specify password to be used to log in.
Required Hostname or address of the machine running the Docker Swarm manager node.
SSH port to connect on the the machine running the Docker Swarm manager node.
Default value: 22
Required User with SSH and Docker privileges on the machine running the Docker Swarm manager node.
Required Private key used for ssh authentication.
Seconds, to wait until the deploy finishes.
Default value: 300
Required Path to the stack file used in the deploy.
Required Name of the stack to be deployed.
name: Deploy Staging
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v2
- name: Deploy
uses: kitconcept/docker-stack-deploy@v1.0.0
with:
remote_host: ${{ secrets.REMOTE_HOST }}
remote_user: ${{ secrets.REMOTE_USER }}
remote_private_key: ${{ secrets.REMOTE_PRIVATE_KEY }}
stack_file: "stacks/plone.yml"
stack_name: "plone-staging"
First, follow the steps to create a Personal Access Token.
name: Deploy Live
on:
push:
tags:
- '*.*.*'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v2
- name: Deploy
uses: kitconcept/docker-stack-deploy@v1.0.0
with:
registry: "ghcr.io"
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
remote_host: ${{ secrets.REMOTE_HOST }}
remote_user: ${{ secrets.REMOTE_USER }}
remote_private_key: ${{ secrets.REMOTE_PRIVATE_KEY }}
stack_file: "stacks/plone.yml"
stack_name: "plone-live"
Please DO NOT commit to version branches directly. Even for the smallest and most trivial fix.
ALWAYS open a pull request and ask somebody else to merge your code. NEVER merge it yourself.
This repository also uses the docker-stack-wait
script, available at GitHub.
The logo is based on rocket icon.
The project is licensed under MIT License