containers/.forgejo/workflows/build-images.yaml

36 lines
991 B
YAML
Raw Normal View History

name: "Build and Push Images"
2024-11-03 20:28:20 +00:00
on:
#push:
# paths:
# - 'apps/*/Dockerfile'
2024-11-03 20:28:20 +00:00
workflow_dispatch:
inputs:
app:
type: string
description: "Optional app to build. Example: 'home-assistant'"
required: false
2024-12-30 20:50:06 +00:00
2024-11-03 20:28:20 +00:00
jobs:
# For each Dockerfile discovered, build & push with Kaniko
2024-12-30 20:50:06 +00:00
build-and-push:
runs-on: ci-os
steps:
- name: Checkout
2024-12-30 20:50:06 +00:00
uses: actions/checkout@v4
- id: set-context
name: Determine Context
run: |
context_dir="/workspace/apps/${{ github.event.inputs.app }}"
echo "context_dir=$context_dir" >> "$GITHUB_OUTPUT"
2024-12-30 20:50:06 +00:00
- name: Build and Push with Kaniko
uses: https://code.252.no/pub/kaniko-action@latest
with:
cache: false
context: ${{ steps.set-context.outputs.context_dir }}
destinations: "code.252.no/${{ github.repository }}/${{ github.event.inputs.app }}:latest"
2024-12-30 20:50:06 +00:00
credentials: "code.252.no=tommy:${{ secrets.REGISTRY_TOKEN }}"
push: "true"