GitHub Action: docker-build-push
Build Docker image and push it
Introduction
Build Docker image and push it.
Usage
name: github-action-docker-build-push
on:
push:
branches: [ master ]
jobs:
context:
runs-on: ubuntu-latest
steps:
- name: github-action-docker-build-push
uses: actions/[email protected]
- name: github-action-docker-build-push
id: build
uses: cloudposse/github-action-docker-build-[email protected]
with:
registry: registry.hub.docker.com
organization: "${{ github.event.repository.owner.login }}"
repository: "${{ github.event.repository.name }}"
login: "${{ secrets.DOCKERHUB_USERNAME }}"
password: "${{ secrets.DOCKERHUB_PASSWORD }}"
outputs:
image: ${{ steps.build.outputs.image }}
tag: ${{ steps.build.outputs.tag }}
Inputs
Name | Description | Default | Required |
---|---|---|---|
build-args | List of build-time variables | N/A | false |
file | Dockerfile name | Dockerfile | false |
login | Docker login | false | |
organization | Organization | N/A | true |
password | Docker password | false | |
registry | Docker registry | N/A | true |
repository | Repository | N/A | true |
tags | List of tags (supports https://github.com/docker/metadata-action#tags-input) | N/A | false |
workdir | Working directory | ./ | false |
Outputs
Name | Description |
---|---|
image | Docker image name |
tag | Docker image tag |