misc
This commit is contained in:
parent
8098a3b5a8
commit
797bdca5e5
1 changed files with 16 additions and 9 deletions
|
@ -8,32 +8,39 @@ on:
|
|||
inputs:
|
||||
app:
|
||||
type: string
|
||||
description: "Optional app to build. Example: 'home-assistant'"
|
||||
required: false
|
||||
description: "App to build, e.g. 'home-assistant'"
|
||||
required: true
|
||||
|
||||
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/pub
|
||||
|
||||
- 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:
|
||||
cache: false
|
||||
# This is the directory that contains your Dockerfile, metadata.yaml, ci/version.sh, etc.
|
||||
context: ${{ steps.set-context.outputs.context_dir }}
|
||||
destinations: "code.252.no/${{ github.repository }}/${{ github.event.inputs.app }}:latest"
|
||||
|
||||
# Kaniko will look for "Dockerfile" by default in the `context` directory.
|
||||
# Provide multiple tags (comma-separated) so you push both "latest" and a version-specific tag:
|
||||
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"
|
||||
|
|
Loading…
Reference in a new issue