This Action provides automation for a Docker builder for a PR. An image is then pushed to a given registry.
REGISTRY
: The image registry where the action is pulling from. Images can be found in https://hub.docker.com/?namespace=vaporioBUILDERIMAGE
: A base image containing the build tool chainSLIMIMAGE
: A smaller image for deploysDOCKERFILE
: Name of the Dockerfile. Usually justDockerfile
USERNAME
: Login user for the image registryPASSWORD
: Password for image registryIMAGENAME
: Name of the image to push into the registry
Since this Action is located in a private repo, a step will checkout this repo with a token so then it can be used in the next step.
# .github/workflows/deploy.yml
name: build
on: ['build']
jobs:
image_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: vapor-ware/workflows
token: ${{ secrets.VIO_REPO_READ }}
ref: main
path: vapor-ware-workflows # Checkouts directory path name for the next step
- uses: ./vapor-ware-workflows/.github/actions/build-pr-image
with:
REGISTRY: docker.io
BUILDERIMAGE: ubuntu:22.04
SLIMIMAGE: ubuntu:22.04
DOCKERFILE: Dockerfile
USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
IMAGENAME: my_image