mirror of
https://github.com/elgohr/Publish-Docker-Github-Action.git
synced 2026-03-12 18:07:12 -04:00
9be95cd5fae941385d8394208229f5a4c1fc4470
Publishes docker containers to Dockerhub
This Action for Docker uses the Git branch as the Docker tag for building and pushing the container. Hereby the master-branch is published as the latest-tag.
Usage
New workflow
name: Publish Docker
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: myDocker/repository
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
Mandatory Arguments
name is the name of the image you would like to push
username the login username for the registry
password the login password for the registry
Optional Arguments
Use registry for pushing to a custom registry
with:
name: myDocker/repository
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: "docker.pkg.github.com"
Use snapshot to push an additional image, which is tagged with the git sha.
When you would like to think about versioning images, this might be useful.
with:
name: myDocker/repository
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
snapshot: true
Use dockerfile when you would like to explicitly build a Dockerfile.
This might be useful when you have multiple DockerImages.
with:
name: myDocker/repository
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: MyDockerFileName
Languages
Shell
96.8%
Dockerfile
2.9%
Makefile
0.3%