Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/userbradley/action-docker
Docker build action
https://github.com/userbradley/action-docker
Last synced: 28 days ago
JSON representation
Docker build action
- Host: GitHub
- URL: https://github.com/userbradley/action-docker
- Owner: userbradley
- Created: 2024-03-16T22:25:05.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-06-17T09:49:07.000Z (6 months ago)
- Last Synced: 2024-10-15T03:31:09.381Z (2 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/[email protected]
- 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: [email protected]
- name: Log docker in to Google Container Store
uses: docker/[email protected]
with:
registry: europe-west2-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: Docker build
uses: userbradley/[email protected]
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` |