Compare commits
4 Commits
77c40c879c
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| cc169c7201 | |||
| c29db12485 | |||
| 8fed82d1a9 | |||
| dd56f6260a |
@@ -1,59 +0,0 @@
|
|||||||
name: BuildKit Build and Deploys
|
|
||||||
description: "Build and deploy images"
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
registry_addr:
|
|
||||||
description: registry address
|
|
||||||
required: true
|
|
||||||
registry_username:
|
|
||||||
description: "registry username"
|
|
||||||
required: true
|
|
||||||
registry_password:
|
|
||||||
description: "registry password"
|
|
||||||
required: true
|
|
||||||
buildkit_addr:
|
|
||||||
description: "buildkit address"
|
|
||||||
required: true
|
|
||||||
default: "false"
|
|
||||||
name:
|
|
||||||
description: ""
|
|
||||||
required: true
|
|
||||||
default: "false"
|
|
||||||
context:
|
|
||||||
description: "buildctl build context"
|
|
||||||
required: false
|
|
||||||
default: "."
|
|
||||||
dockerfile:
|
|
||||||
description: "buildctl build dockerfile/folder"
|
|
||||||
required: true
|
|
||||||
default: "false"
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Authenticate to Gitea registry
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
Create a temporary file inside GITHUB_TEMP
|
|
||||||
DOCKER_CONFIG_FILE="${GITHUB_TEMP}/docker_config.json"
|
|
||||||
|
|
||||||
# Ensure cleanup ALWAYS happens
|
|
||||||
trap 'rm -f "$DOCKER_CONFIG_FILE"' EXIT
|
|
||||||
|
|
||||||
# Generate auth entry
|
|
||||||
AUTH=$(printf "%s" "${{ inputs.registry_username }}:${{ inputs.registry_password }}" | base64 -w 0)
|
|
||||||
|
|
||||||
printf '{"auths":{"%s":{"auth":"%s"}}}' \
|
|
||||||
"${{ inputs.registry_addr }}" \
|
|
||||||
"$AUTH" \
|
|
||||||
> "$DOCKER_CONFIG_FILE"
|
|
||||||
|
|
||||||
# Run BuildKit build
|
|
||||||
buildctl \
|
|
||||||
--addr ${{ inputs.buildkit_addr }} \
|
|
||||||
build \
|
|
||||||
--frontend=dockerfile.v0 \
|
|
||||||
--local context=${{ inputs.context }} \
|
|
||||||
--local dockerfile=${{ inputs.dockerfile }} \
|
|
||||||
--opt filename=Dockerfile \
|
|
||||||
--output type=image,name=${{ inputs.tags }},push=true,registry.config=$DOCKER_CONFIG_FILE
|
|
||||||
|
|
||||||
@@ -1,29 +1,36 @@
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- "docker/**"
|
|
||||||
- ".gitea/**"
|
- ".gitea/**"
|
||||||
- "pbsclient/**"
|
- "pbs-client/**"
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 16 * * Sun"
|
- cron: "0 16 * * Sun"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build-image:
|
build-image:
|
||||||
runs-on: oci-image-builder
|
runs-on: ["oci-image-builder", "amd64"]
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Fetch limbo public actions
|
||||||
|
env:
|
||||||
|
RUNNER_TEMP: "${{ runner.temp }}"
|
||||||
|
WORKSPACE: "${{ gitea.workspace }}"
|
||||||
|
run: |
|
||||||
|
curl -fsSL https://git.limbosolutions.com/kb/gitea/raw/branch/main/cloud-scripts/setup-limbo-actions.sh | bash 2>&1
|
||||||
|
|
||||||
- name: Build and Push Image
|
- name: Build and Push Image
|
||||||
uses: ./.gitea/actions/buildkit-build-push
|
uses: ./.gitea/limbo_actions/buildkit-build-push
|
||||||
with:
|
with:
|
||||||
registry_addr: git.limbosolutions.com
|
registry_addr: git.limbosolutions.com
|
||||||
registry_username: ${{ secrets.GITLIMBO_DOCKER_REGISTRY_USERNAME }}
|
registry_username: ${{ secrets.GITLIMBO_DOCKER_REGISTRY_USERNAME }}
|
||||||
registry_password: ${{ secrets.GITLIMBO_DOCKER_REGISTRY_PASSWORD }}
|
registry_password: ${{ secrets.GITLIMBO_DOCKER_REGISTRY_PASSWORD }}
|
||||||
buildkit_addr: tcp://buildkitd.buildkit.svc.cluster.local:1234
|
buildkit_addr: tcp://buildkitd.buildkit.svc.cluster.local:1234
|
||||||
context: ./pbsclient
|
context: ./pbs-client
|
||||||
dockerfile: ./pbsclient/docker
|
dockerfile: ./pbs-client/docker
|
||||||
name: git.limbosolutions.com/kb/pbsclient:latest
|
tags: git.limbosolutions.com/kb/pbs-client:latest
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user