41 lines
1.2 KiB
YAML
41 lines
1.2 KiB
YAML
name: "Build and Push Images"
|
|
|
|
on:
|
|
#push:
|
|
# paths:
|
|
# - 'apps/*/Dockerfile'
|
|
workflow_dispatch:
|
|
inputs:
|
|
app:
|
|
type: string
|
|
description: "App to build, e.g. 'home-assistant'"
|
|
required: true
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ci-os
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- id: set-context
|
|
name: Determine Context
|
|
run: |
|
|
context_dir="/workspace/pub/containers/apps/${{ github.event.inputs.app }}"
|
|
echo "context_dir=$context_dir" >> "$GITHUB_OUTPUT"
|
|
|
|
- id: read-version
|
|
name: Read Version from version.sh
|
|
run: |
|
|
version=$(bash "${{ steps.set-context.outputs.context_dir }}/ci/version.sh" || echo "")
|
|
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Build and Push with Kaniko
|
|
uses: https://code.252.no/pub/kaniko-action@latest
|
|
with:
|
|
context: ${{ steps.set-context.outputs.context_dir }}
|
|
destinations: >
|
|
code.252.no/${{ github.repository }}/${{ github.event.inputs.app }}:latest code.252.no/${{ github.repository }}/${{ github.event.inputs.app }}:${{ steps.read-version.outputs.version }}
|
|
credentials: "code.252.no=tommy:${{ secrets.REGISTRY_TOKEN }}"
|
|
push: "true"
|
|
cache: "false"
|