Docker Context Action
Set up a Remote Docker Context over SSH using Password or Keyfile Authentication. This allows all subsequent docker
commands to run on the remote host/context.
To easily deploy a swarm or compose stack use: cssnr/stack-deploy-action
To deploy directly to Portainer use: cssnr/portainer-stack-deploy-action
To get started, create or update your workflow file.
Workflow
Add the step to an existing workflow or create a new one.
- name: "Docker Context"
uses: cssnr/docker-context-action@v1
with:
host: ${{ secrets.DOCKER_HOST }}
user: ${{ secrets.DOCKER_USER }}
pass: ${{ secrets.DOCKER_PASS }}
- name: "Stack Deploy"
runs: docker stack deploy -c docker-compose.yaml --detach=false stack-name
name: "Deploy"
on:
workflow_dispatch:
jobs:
deploy:
name: "Deploy"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: "Checkout"
uses: actions/checkout@v5
- name: "Docker Context"
uses: cssnr/docker-context-action@v1
with:
host: ${{ secrets.DOCKER_HOST }}
user: ${{ secrets.DOCKER_USER }}
pass: ${{ secrets.DOCKER_PASS }}
- name: "Stack Deploy"
runs: docker stack deploy -c docker-compose.yaml --detach=false stack-name
Hash Copied to Clipboard
Check out the Rolling Tags for more tag options.
See the Inputs Documentation for additional options and default values.
Features
- Configure SSH using keyfile or password: src/ssh.sh
- Creates and uses a remote docker context: src/context.sh
- Option to run Docker login for any registry: src/login.sh
- Clean up the authorized_keys file for password: src/cleanup.sh
Don't see your feature here? Please help by submitting a Feature Request.
Rolling Tags
The following rolling tags are maintained to improve stability across updates.
Version Tag | Rolling | Bugs | Feat. | Name | Target | Example |
---|---|---|---|---|---|---|
✅ | ✅ | ✅ | Major | vN.x.x | vN | |
✅ | ✅ | ❌ | Minor | vN.N.x | vN.N | |
❌ | ❌ | ❌ | Micro | vN.N.N | vN.N.N |
You can view the release notes for each version on the releases page.
The Major tag is recommended. It is the most up-to-date and always backwards compatible. Breaking changes would result in a Major version bump. At a minimum you should use a Minor tag.
Tags Security Notice
As shown above, tags are mutable; however, commit hashes are not. Therefore, if security is your top priority, you should pin your actions to a specific commit hash.
WARNING
These docs are not finished. Please see the README.md on GitHub.