https://github.com/manusa/actions-publish-docker
This GitHub action allows you to create and publish Docker images into a Docker registry.
https://github.com/manusa/actions-publish-docker
action ci docker javascript
Last synced: 11 months ago
JSON representation
This GitHub action allows you to create and publish Docker images into a Docker registry.
- Host: GitHub
- URL: https://github.com/manusa/actions-publish-docker
- Owner: manusa
- License: apache-2.0
- Created: 2019-09-06T16:18:05.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T02:07:59.000Z (over 3 years ago)
- Last Synced: 2025-07-16T22:16:28.806Z (12 months ago)
- Topics: action, ci, docker, javascript
- Language: JavaScript
- Homepage: https://www.marcnuri.com
- Size: 992 KB
- Stars: 15
- Watchers: 2
- Forks: 4
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Publish to Docker GitHub Action
===============================
[
](https://github.com/manusa/actions-publish-docker/actions)
This GitHub action allows you to create and publish Docker images into a Docker registry.
## Usage
### Basic
```yaml
steps:
- name: Checkout
uses: actions/checkout@v1
- run: commandToBuildYourProject.sh
- name: Dockerize
if: success()
uses: manusa/actions-publish-docker@v1.1.2
with:
name: organization/image_name
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
```
### Required input parameters
| Parameter | Description |
| ---------- | ---------------------------- |
| `name` | Name of the Docker image |
| `username` | Username for Docker registry |
| `password` | Password for Docker registry |
By default the published image will be tagged using the git branch or tag name (`master` branch
will be tagged as `latest`).
### Optional input parameters
| Parameter | Description |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tag` | Tag for the Docker image |
| `tag script` | Script to compute tag name for the Docker image, receives `context` as a variable. Ignored if used together with `tag` parameter |
| `registry` | URL for the Docker registry to login |
| `include pull requests` | By default (to avoid accidents) action is ignored in pull requests. This parameter will force publishing the image even if the action was triggered from a pull request |
| `dockerfile path` | By default the path to the `Dockerfile` is `.`, this parameter lets you change this. |
### Advanced
```yaml
steps:
- name: Checkout
uses: actions/checkout@v1
- run: commandToBuildYourProject.sh
- name: Dockerize
if: success()
uses: manusa/actions-publish-docker@v1.1.2
with:
name: organization/image_name
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
tag script: |
return context.ref
.replace('refs/heads/
.replace('refs/tags/'
.replace('refs/pull/'
.replace(/\//g, '_')
.replace(/#/g, '');
registry: localhost:5000
```
## License
The scripts and documentation in this project are released under the [Apache 2.0](./LICENSE).