Skip to content

Scheduled Release

Scheduled Release #113

Workflow file for this run

---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Scheduled Release
concurrency:
group: container-release
cancel-in-progress: false
on:
workflow_dispatch:
inputs:
apps:
description: App(s)
required: false
type: string
action:
description: Action
required: false
default: 'build'
type: choice
options:
- build
- clean
schedule:
- cron: "0 1 * * *"
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
apps: "${{ steps.prep-apps.outputs.apps }}"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Populate apps
id: prep-apps
shell: bash
run: |
IMAGES="$(find images -mindepth 1 -maxdepth 1 -type d -printf %f\\n | jq -R -s -c 'split("\n")[:-1]')"
INPUT='${{ inputs.apps }}'
echo "apps=${INPUT:-$IMAGES}" >> $GITHUB_OUTPUT
build-images:
if: ${{ inputs.action == null || inputs.action == 'build' }}
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
image: ${{ fromJSON(needs.prepare.outputs.apps) }}
uses: lehmanju/containers/.github/workflows/build-images.yaml@main
needs: ["prepare"]
secrets: inherit
with:
image: "${{ matrix.image }}"
push: true
cleanup:
runs-on: ubuntu-latest
if: ${{ inputs.action == null || inputs.action == 'clean' }}
needs: ["prepare"]
strategy:
fail-fast: false
matrix:
image: "${{ fromJSON(needs.prepare.outputs.apps) }}"
permissions:
contents: read
packages: write
steps:
- name: Cleanup old containers
uses: actions/delete-package-versions@v5
with:
package-name: '${{ matrix.image }}'
package-type: 'container'
min-versions-to-keep: 10
delete-only-untagged-versions: 'true'