https://github.com/userbradley/action-docker
Docker build action
https://github.com/userbradley/action-docker
Last synced: 9 months ago
JSON representation
Docker build action
- Host: GitHub
- URL: https://github.com/userbradley/action-docker
- Owner: userbradley
- Created: 2024-03-16T22:25:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-17T09:49:07.000Z (over 1 year ago)
- Last Synced: 2025-01-27T05:49:40.682Z (10 months ago)
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GitHub Action: Docker build and push
A GitHub action to build and push docker images
> [!NOTE]
> This is a highly specific docker action I use, so if you wish to use it, fork and adjust to suit your needs
## Quick Start
```yaml
on: [push]
name: "Docker build: "
jobs:
docker-build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
name: Docker Build
steps:
- uses: actions/checkout@v4.1.1
- name: Authenticate to Google
id: auth
uses: google-github-actions/auth@v2
with:
workload_identity_provider: projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
service_account: my-service-account@my-project.iam.gserviceaccount.com
- name: Log docker in to Google Container Store
uses: docker/login-action@v3.1.0
with:
registry: europe-west2-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: Docker build
uses: userbradley/action-docker@v1.0.0
with:
googleProject: project
repository: repo
image: image
directory: containers/name
```
## Inputs
| Name | Description | Required | Default Value |
|-----------------|----------------------------------------------------|----------|-------------------|
| `googleProject` | Name of the google artifact registry project | `true` | `Null` |
| `repository` | Name of the Artifact Registry Repository | `true` | `Null` |
| `image` | Name of the Image to build | `true` | `Null` |
| `directory` | Name of the Directory that contains the Dockerfile | `false` | `containers/name` |
| `dockerfile` | Name of the Dockerfile if not `Dockerfile` | `false` | `Dockerfile` |