Introduce four workflows to automate Docker builds and pushes using Kaniko. These workflows cover push events to the `master` branch, pull requests, tag pushes, and other branches. They streamline image publishing to the specified registry with proper secrets configuration.
This commit is contained in:
parent
a487046931
commit
50b53e3700
4 changed files with 86 additions and 0 deletions
.forgejo/workflows
23
.forgejo/workflows/docker-dev.yaml
Normal file
23
.forgejo/workflows/docker-dev.yaml
Normal file
|
@ -0,0 +1,23 @@
|
|||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'master'
|
||||
jobs:
|
||||
docker-dev:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: git.van-hemmen.com/actions/kaniko:25.21.1
|
||||
steps:
|
||||
- name: Build & push with Kaniko
|
||||
run: /bin/build.sh
|
||||
env:
|
||||
# --- mandatory --------------------------------------------------------
|
||||
KANIKO_CONTEXT: git://git.van-hemmen.com/GuillaumeHemmen/debian-node-firebase.git
|
||||
GIT_REF_NAME: ${{ github.ref_name }}
|
||||
GIT_USERNAME: ${{ secrets.docker_username }}
|
||||
GIT_PASSWORD: ${{ secrets.access_token }}
|
||||
|
||||
# --- optional (only needed when you plan to push) ---------------------
|
||||
REGISTRY_USER: ${{ secrets.docker_username }}
|
||||
REGISTRY_PASS: ${{ secrets.access_token }}
|
||||
KANIKO_DESTINATION: git.van-hemmen.com/GuillaumeHemmen/debian-node-firebase:${GITHUB_SHA}
|
23
.forgejo/workflows/docker-master.yaml
Normal file
23
.forgejo/workflows/docker-master.yaml
Normal file
|
@ -0,0 +1,23 @@
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
jobs:
|
||||
docker-master:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: git.van-hemmen.com/actions/kaniko:25.21.1
|
||||
steps:
|
||||
- name: Build & push with Kaniko
|
||||
run: /bin/build.sh
|
||||
env:
|
||||
# --- mandatory --------------------------------------------------------
|
||||
KANIKO_CONTEXT: git://git.van-hemmen.com/GuillaumeHemmen/debian-node-firebase.git
|
||||
GIT_REF_NAME: ${{ github.ref_name }}
|
||||
GIT_USERNAME: ${{ secrets.docker_username }}
|
||||
GIT_PASSWORD: ${{ secrets.access_token }}
|
||||
|
||||
# --- optional (only needed when you plan to push) ---------------------
|
||||
REGISTRY_USER: ${{ secrets.docker_username }}
|
||||
REGISTRY_PASS: ${{ secrets.access_token }}
|
||||
KANIKO_DESTINATION: git.van-hemmen.com/GuillaumeHemmen/debian-node-firebase:${GITHUB_SHA},git.van-hemmen.com/GuillaumeHemmen/debian-node-firebase:latest
|
17
.forgejo/workflows/docker-pr.yaml
Normal file
17
.forgejo/workflows/docker-pr.yaml
Normal file
|
@ -0,0 +1,17 @@
|
|||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
docker-pr:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: git.van-hemmen.com/actions/kaniko:25.21.1
|
||||
steps:
|
||||
- name: Build & push with Kaniko
|
||||
run: /bin/build.sh
|
||||
env:
|
||||
# --- mandatory --------------------------------------------------------
|
||||
KANIKO_CONTEXT: git://git.van-hemmen.com/GuillaumeHemmen/debian-node-firebase.git
|
||||
GIT_REF_NAME: ${{ github.head_ref }}
|
||||
GIT_USERNAME: ${{ secrets.docker_username }}
|
||||
GIT_PASSWORD: ${{ secrets.access_token }}
|
23
.forgejo/workflows/docker-tag.yaml
Normal file
23
.forgejo/workflows/docker-tag.yaml
Normal file
|
@ -0,0 +1,23 @@
|
|||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
jobs:
|
||||
docker-tag:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
steps:
|
||||
- name: Build & push with Kaniko
|
||||
run: /bin/build.sh
|
||||
env:
|
||||
# --- mandatory --------------------------------------------------------
|
||||
KANIKO_CONTEXT: git://git.van-hemmen.com/GuillaumeHemmen/debian-node-firebase.git
|
||||
GIT_REF_NAME: ${{ github.ref_name }}
|
||||
GIT_USERNAME: ${{ secrets.docker_username }}
|
||||
GIT_PASSWORD: ${{ secrets.access_token }}
|
||||
|
||||
# --- optional (only needed when you plan to push) ---------------------
|
||||
REGISTRY_USER: ${{ secrets.docker_username }}
|
||||
REGISTRY_PASS: ${{ secrets.access_token }}
|
||||
KANIKO_DESTINATION: git.van-hemmen.com/GuillaumeHemmen/debian-node-firebase:${GITHUB_REF_NAME},git.van-hemmen.com/GuillaumeHemmen/debian-node-firebase:latest
|
Loading…
Add table
Add a link
Reference in a new issue