2026-10-07 16:01:40 +02:00
|
|
|
# kaniko-action
|
|
|
|
|
|
|
|
|
|
## Requirements
|
|
|
|
|
|
|
|
|
|
The repository that calls the action must have valid secrets to push to registry:
|
|
|
|
|
|
|
|
|
|
- `REGISTRY_USER`
|
|
|
|
|
- `REGISTRY_TOKEN`
|
|
|
|
|
|
|
|
|
|
The repository that calls the action must have cross-repository access to this repository.
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
name: kaniko build
|
|
|
|
|
on:
|
|
|
|
|
push:
|
|
|
|
|
branches: [master]
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
build-and-push:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
container:
|
|
|
|
|
image: ghcr.io/osscontainertools/kaniko:alpine
|
|
|
|
|
steps:
|
2026-10-07 16:22:31 +02:00
|
|
|
# Required
|
|
|
|
|
- name: Install NodeJS for Action Compatibility
|
|
|
|
|
run: apk add --no-cache nodejs
|
|
|
|
|
|
2026-10-07 16:01:40 +02:00
|
|
|
- name: Checkout Source Code
|
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
|
|
- name: Run Kaniko Build Push Action
|
|
|
|
|
uses: https://code.verua.online/verua/kaniko-action
|
|
|
|
|
with:
|
|
|
|
|
registry_user: ${{ secrets.REGISTRY_USER }}
|
|
|
|
|
registry_token: ${{ secrets.REGISTRY_TOKEN }}
|
2026-10-07 16:22:31 +02:00
|
|
|
dockerfile_path: 'sub-directory/Dockerfile'
|
|
|
|
|
target_stage: 'development' # optional
|
|
|
|
|
destination_image: '${{ forgejo.repository }}/my-awesome-image'
|
|
|
|
|
image_tag: 'latest' # optional
|
2026-10-07 16:01:40 +02:00
|
|
|
```
|