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:
|
inputs:
|
||||||
app:
|
app:
|
||||||
type: string
|
type: string
|
||||||
description: "Optional app to build. Example: 'home-assistant'"
|
description: "App to build, e.g. 'home-assistant'"
|
||||||
required: false
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# For each Dockerfile discovered, build & push with Kaniko
|
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: ci-os
|
runs-on: ci-os
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Test
|
|
||||||
run: |
|
|
||||||
ls -lhart /workspace/pub
|
|
||||||
|
|
||||||
- id: set-context
|
- id: set-context
|
||||||
name: Determine Context
|
name: Determine Context
|
||||||
run: |
|
run: |
|
||||||
context_dir="/workspace/pub/containers/apps/${{ github.event.inputs.app }}"
|
context_dir="/workspace/pub/containers/apps/${{ github.event.inputs.app }}"
|
||||||
echo "context_dir=$context_dir" >> "$GITHUB_OUTPUT"
|
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
|
- name: Build and Push with Kaniko
|
||||||
uses: https://code.252.no/pub/kaniko-action@latest
|
uses: https://code.252.no/pub/kaniko-action@latest
|
||||||
with:
|
with:
|
||||||
cache: false
|
# This is the directory that contains your Dockerfile, metadata.yaml, ci/version.sh, etc.
|
||||||
context: ${{ steps.set-context.outputs.context_dir }}
|
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 }}"
|
credentials: "code.252.no=tommy:${{ secrets.REGISTRY_TOKEN }}"
|
||||||
push: "true"
|
push: "true"
|
||||||
|
cache: "false"
|
||||||
|
|
Loading…
Reference in a new issue