test
This commit is contained in:
parent
1b6ef06d21
commit
93934f785f
2 changed files with 14 additions and 12 deletions
|
|
@ -3,9 +3,6 @@ name: Reusable Docker Build
|
|||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
image_name:
|
||||
required: true
|
||||
type: string
|
||||
context:
|
||||
required: false
|
||||
type: string
|
||||
|
|
@ -14,11 +11,6 @@ on:
|
|||
required: false
|
||||
type: string
|
||||
default: "./Dockerfile"
|
||||
secrets:
|
||||
REGISTRY_USERNAME:
|
||||
required: true
|
||||
REGISTRY_TOKEN:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
|
@ -36,7 +28,7 @@ jobs:
|
|||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: git.vodyanoysh.ru/${{ inputs.image_name }}
|
||||
images: git.vodyanoysh.ru/system/${{ github.repository }}
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
|
|
@ -58,4 +50,4 @@ jobs:
|
|||
file: ${{ inputs.dockerfile }}
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
|
|
|||
14
README.md
14
README.md
|
|
@ -1,5 +1,7 @@
|
|||
|
||||
usage:
|
||||
## Usage
|
||||
|
||||
In your project's `.forgejo/workflows/build.yml`:
|
||||
|
||||
```yaml
|
||||
name: Build
|
||||
|
|
@ -13,7 +15,15 @@ on:
|
|||
jobs:
|
||||
docker-build:
|
||||
uses: vodyanoy/ci-workflows/.forgejo/workflows/docker-build.yml@master
|
||||
with:
|
||||
image_name: vodyanoy/your-project # required: org/repo as it appears in the registry
|
||||
secrets:
|
||||
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
||||
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||
```
|
||||
```
|
||||
|
||||
### Available workflows
|
||||
|
||||
| Workflow | Trigger | Inputs | Secrets |
|
||||
|---|---|---|---|
|
||||
| `docker-build.yml` | `workflow_call` | `image_name` (required), `context` (default `.`), `dockerfile` (default `./Dockerfile`) | `REGISTRY_USERNAME`, `REGISTRY_TOKEN` |
|
||||
|
|
|
|||
Loading…
Reference in a new issue