push reuseable workflow
Some checks failed
Some checks failed
This commit is contained in:
@ -1,7 +1,6 @@
|
|||||||
name: build_push_container
|
name: build_push_container
|
||||||
|
|
||||||
on:
|
on: [push]
|
||||||
workflow_call:
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -13,7 +12,7 @@ jobs:
|
|||||||
RUNNER_TOOL_CACHE: /toolcache
|
RUNNER_TOOL_CACHE: /toolcache
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [latest]
|
os: [3.20.0, 3.21.0, 3.22.0]
|
||||||
steps:
|
steps:
|
||||||
- name: "Build: checkout"
|
- name: "Build: checkout"
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
89
.gitea/workflows/build_container_reusable1.yml
Normal file
89
.gitea/workflows/build_container_reusable1.yml
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
name: build_push_container
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
repository:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
ref:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
secrets:
|
||||||
|
token:
|
||||||
|
required: true
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
# container: ghcr.io/catthehacker/ubuntu:act-latest
|
||||||
|
env:
|
||||||
|
DOCKER_ORG: teacup
|
||||||
|
DOCKER_LATEST: nightly
|
||||||
|
RUNNER_TOOL_CACHE: /toolcache
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [latest]
|
||||||
|
steps:
|
||||||
|
- name: "Build: checkout"
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: "Build: set up Docker buildx"
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
buildkitd-flags: --debug
|
||||||
|
|
||||||
|
- name: "Build: login to registry"
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: https://${{ secrets.MY_REGISTRY }}
|
||||||
|
username: ${{ secrets.MY_REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.MY_REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Extract metadata (tags, labels) for Docker
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ${{ secrets.MY_REGISTRY }}/${{ github.repository }}
|
||||||
|
|
||||||
|
- name: Set Image Name
|
||||||
|
env:
|
||||||
|
myTITLE: ${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.title'] }}
|
||||||
|
id: split
|
||||||
|
run: echo "myTITLE=${myTITLE##*d_}" | tee -a "$GITHUB_ENV"
|
||||||
|
|
||||||
|
# - name: Show Image Name
|
||||||
|
# run: echo ${{ env.myTITLE }}
|
||||||
|
|
||||||
|
- name: "Build: build and push dockerimage"
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
build-args: |
|
||||||
|
VERSION=${{ matrix.os }}
|
||||||
|
NAS_USER=dnke
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: ${{ secrets.MY_REGISTRY }}/${{ secrets.MY_REGISTRY_USERNAME }}/${{ env.myTITLE }}:${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
|
- name: "Build: build and push dockerimage"
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
build-args: |
|
||||||
|
VERSION=${{ matrix.os }}
|
||||||
|
NAS_USER=dnke
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: ${{ secrets.MY_REGISTRY }}/${{ secrets.MY_REGISTRY_USERNAME }}/${{ env.myTITLE }}:${{ matrix.os }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
|
- name: "Build: build and push dockerimage"
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
build-args: |
|
||||||
|
VERSION=${{ matrix.os }}
|
||||||
|
NAS_USER=dnke
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: ${{ secrets.MY_REGISTRY }}/${{ secrets.MY_REGISTRY_USERNAME }}/${{ env.myTITLE }}:latest
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
70
.gitea/workflows/build_container_reuseable.yml
Normal file
70
.gitea/workflows/build_container_reuseable.yml
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
name: Build and Push Container
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
registry:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
registry_username:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
registry_password:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
titles:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
DOCKER_ORG: teacup
|
||||||
|
DOCKER_LATEST: nightly
|
||||||
|
RUNNER_TOOL_CACHE: /toolcache
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [3.20.0, 3.21.0, 3.22.0]
|
||||||
|
steps:
|
||||||
|
- name: "Build: checkout"
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: "Build: set up Docker buildx"
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
buildkitd-flags: --debug
|
||||||
|
|
||||||
|
- name: "Build: login to registry"
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ inputs.registry }}
|
||||||
|
username: ${{ inputs.registry_username }}
|
||||||
|
password: ${{ secrets.MY_REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Extract metadata (tags, labels) for Docker
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ${{ inputs.registry }}/${{ github.repository }}
|
||||||
|
|
||||||
|
- name: Set Image Name
|
||||||
|
env:
|
||||||
|
myTITLE: ${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.title'] }}
|
||||||
|
id: split
|
||||||
|
run: echo "myTITLE=${myTITLE##*d_}" | tee -a "$GITHUB_ENV"
|
||||||
|
|
||||||
|
# Build and push Docker images
|
||||||
|
- name: "Build and push Docker image for each version"
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
build-args: |
|
||||||
|
VERSION=${{ matrix.os }}
|
||||||
|
NAS_USER=dnke
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ inputs.registry }}/${{ inputs.registry_username }}/${{ env.myTITLE }}:${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
|
||||||
|
${{ inputs.registry }}/${{ inputs.registry_username }}/${{ env.myTITLE }}:${{ matrix.os }}
|
||||||
|
${{ inputs.registry }}/${{ inputs.registry_username }}/${{ env.myTITLE }}:latest
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
12
.gitea/workflows/caller.yml
Normal file
12
.gitea/workflows/caller.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
name: CI Workflow
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_push:
|
||||||
|
uses: ./.github/workflows/build_push_container.yml
|
||||||
|
with:
|
||||||
|
registry: https://${{ secrets.MY_REGISTRY }}
|
||||||
|
registry_username: ${{ secrets.MY_REGISTRY_USERNAME }}
|
||||||
|
registry_password: ${{ secrets.MY_REGISTRY_PASSWORD }}
|
||||||
|
titles: 'Your Image Title' # Specify any required titles or metadata if needed
|
||||||
Reference in New Issue
Block a user