Builds and pushes a tagged image to a specified Docker repository. It relies on buildx to cache Docker layers wherever applicable.
read:
runs-on: ubuntu-latest
steps:
- name: Build and push to Docker
uses: truemark/docker-build-pattern-action@v2
with:
registry: "${{ secrets.DOCKER_HUB_REGISTRY }}"
username: "${{ secrets.DOCKER_HUB_USERNAME }}"
password: "${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}"
image: "test-tag:${{ github.run_number }}"
Name | Type | Required | Description |
---|---|---|---|
registry | string | Yes | Docker registry to log into. |
username | string | Yes | Docker username to log in with. |
password | string | Yes | Docker password to log in with. |
image | string | Yes | Docker image tag to build and push. |
context | string | No | Location of the Dockerfile. Defaults to root. |