39 lines
1 KiB
YAML
39 lines
1 KiB
YAML
name: "Build and Push Images"
|
|
|
|
on:
|
|
#push:
|
|
# paths:
|
|
# - 'apps/*/Dockerfile'
|
|
workflow_dispatch:
|
|
inputs:
|
|
app:
|
|
type: string
|
|
description: "Optional app to build. Example: 'home-assistant'"
|
|
required: false
|
|
|
|
jobs:
|
|
# For each Dockerfile discovered, build & push with Kaniko
|
|
build-and-push:
|
|
runs-on: ci-os
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Test
|
|
run: |
|
|
ls -lhart /workspace
|
|
|
|
- id: set-context
|
|
name: Determine Context
|
|
run: |
|
|
context_dir="/workspace/containers/apps/${{ github.event.inputs.app }}"
|
|
echo "context_dir=$context_dir" >> "$GITHUB_OUTPUT"
|
|
|
|
- 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"
|
|
credentials: "code.252.no=tommy:${{ secrets.REGISTRY_TOKEN }}"
|
|
push: "true"
|