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"
run: docker stack deploy -c docker-compose.yaml --detach=false stack-namename: "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"
run: docker stack deploy -c docker-compose.yaml --detach=false stack-nameHash 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.
Updating Actions
If you prefer to manually update actions, then azat-io/actions-up was created to allow you to easily and securely do this using an interactive CLI with optional excludes.
I also created cssnr/actions-up-action that will run this for you automatically and generate a markdown table for pull requests.
View Example Markdown Table
Scanned 8 workflows, checked 12 actions and found 6 updates.Results
| Name | File | Breaking | Latest |
|---|---|---|---|
| cssnr/check-build-action | check-build.yaml | - | v1.1.0 |
| cssnr/label-creator-action | labeler.yaml | - | v1.0.2 |
| cssnr/mirror-repository-action | mirror.yaml | - | v1.2.0 |
| cssnr/update-version-tags-action | release.yaml | - | v1.3.1 |
| cssnr/package-changelog-action | release.yaml | ⚠️ | v2.0.0 |
| cssnr/update-version-tags-action | tags.yaml | - | v1.3.1 |
WARNING
These docs are not finished. Please see the README.md on GitHub.
