Personal GitHub Actions for Docker Containers and Code Formatting
Automatically builds and pushes images to Docker Hub.
Required Inputs:
image_name
: (name of image)
Optional Inputs:
registry
: (defaults todocker.io
)context
: (defaults to.
)dockerfile
: (defaults toDockerfile
)platforms
: (defaults tolinux/amd64,linux/arm64,linux/arm/v7
)image_tag
: (defaults tolatest
)should_push
: (defaults tofalse
)
Optional Secrets:
DOCKER_REGISTRY_USERNAME
DOCKER_REGISTRY_PASSWORD
Minimal Config (Only builds, does not push):
jobs:
call-dockerhub-action:
uses: NelsonDane/Cusotm-GitHub-Actions/.github/workflows/docker-registry-build-push.yml@main
with:
image_name: name of image
Example Config:
jobs:
call-dockerhub-action:
uses: NelsonDane/Cusotm-GitHub-Actions/.github/workflows/docker-registry-build-push.yml@main
with:
image_name: name of image
platforms: (optional, comma-seperated with no spaces)
image_tag: (optional)
should_push: (optional)
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
Automatically updates the Docker Hub README/Description with the contents of the README.md file in the GitHub repo.
Required Inputs:
image_name
Required Secrets:
DOCKERHUB_USERNAME
DOCKERHUB_PASSWORD
Example Config:
jobs:
call-dockerhub-action:
uses: NelsonDane/Cusotm-GitHub-Actions/.github/workflows/dockerhub-description.yml@main
with:
image_name: (name of image)
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
Automatically formats Python code with Black.
Optional Inputs:
black_command
: (defaults toblack .
)
Example Config:
jobs:
call-dockerhub-action:
uses: NelsonDane/Cusotm-GitHub-Actions/.github/workflows/python-black-formatter.yml@main
with:
black_command: (optional)
Automatically formats Python imports with isort and removes unused imports.
Optional Inputs:
isort_command
: (defaults toisort .
)
Example Config:
jobs:
call-dockerhub-action:
uses: NelsonDane/Cusotm-GitHub-Actions/.github/workflows/python-isort-formatter.yml@main
with:
isort_command: (optional)