Skip to content

Commit

Permalink
github/workflows: Configure image uploading
Browse files Browse the repository at this point in the history
When image workflow is called from another workflow, enable image uploading by default.
When image workflow is triggered manually, disable image upload by default.

Signed-off-by: Din Music <[email protected]>
  • Loading branch information
MusicDin committed Mar 22, 2024
1 parent c6be3aa commit 26d50af
Show file tree
Hide file tree
Showing 21 changed files with 166 additions and 42 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/image-almalinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ name: Build AlmaLinux Images

on:
workflow_dispatch:
workflow_call:
inputs:
publish:
type: boolean
default: false
description: Publish built image
workflow_call:
inputs:
publish:
type: boolean
default: true
description: Publish built image

jobs:
almalinux:
Expand Down Expand Up @@ -88,5 +93,6 @@ jobs:
uses: ./.github/actions/image-upload
if: inputs.publish == true
with:
name: "${{ env.distro }}-${{ matrix.release }}-${{ matrix.architecture }}-${{ matrix.variant }}"
target: ${{ env.target }}
image_dir: "${{ env.distro }}/${{ matrix.release }}/${{ matrix.architecture }}/${{ matrix.variant }}"
ssh_private_key: "${{ secrets.LXD_INFRA_IMAGES_KEY }}"
10 changes: 8 additions & 2 deletions .github/workflows/image-alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ name: Build Alpine Images

on:
workflow_dispatch:
workflow_call:
inputs:
publish:
type: boolean
default: false
description: Publish built image
workflow_call:
inputs:
publish:
type: boolean
default: true
description: Publish built image

jobs:
alpine:
Expand Down Expand Up @@ -90,5 +95,6 @@ jobs:
uses: ./.github/actions/image-upload
if: inputs.publish == true
with:
name: "${{ env.distro }}-${{ matrix.release }}-${{ matrix.architecture }}-${{ matrix.variant }}"
target: ${{ env.target }}
image_dir: "${{ env.distro }}/${{ matrix.release }}/${{ matrix.architecture }}/${{ matrix.variant }}"
ssh_private_key: "${{ secrets.LXD_INFRA_IMAGES_KEY }}"
10 changes: 8 additions & 2 deletions .github/workflows/image-alt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ name: Build ALT Linux Images

on:
workflow_dispatch:
workflow_call:
inputs:
publish:
type: boolean
default: false
description: Publish built image
workflow_call:
inputs:
publish:
type: boolean
default: true
description: Publish built image

jobs:
alt:
Expand Down Expand Up @@ -77,5 +82,6 @@ jobs:
uses: ./.github/actions/image-upload
if: inputs.publish == true
with:
name: "${{ env.distro }}-${{ matrix.release }}-${{ matrix.architecture }}-${{ matrix.variant }}"
target: ${{ env.target }}
image_dir: "${{ env.distro }}/${{ matrix.release }}/${{ matrix.architecture }}/${{ matrix.variant }}"
ssh_private_key: "${{ secrets.LXD_INFRA_IMAGES_KEY }}"
10 changes: 8 additions & 2 deletions .github/workflows/image-amazonlinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ name: Build AmazonLinux Images

on:
workflow_dispatch:
workflow_call:
inputs:
publish:
type: boolean
default: false
description: Publish built image
workflow_call:
inputs:
publish:
type: boolean
default: true
description: Publish built image

jobs:
amazonlinux:
Expand Down Expand Up @@ -103,5 +108,6 @@ jobs:
uses: ./.github/actions/image-upload
if: inputs.publish == true
with:
name: "${{ env.distro }}-${{ matrix.release }}-${{ matrix.architecture }}-${{ matrix.variant }}"
target: ${{ env.target }}
image_dir: "${{ env.distro }}/${{ matrix.release }}/${{ matrix.architecture }}/${{ matrix.variant }}"
ssh_private_key: "${{ secrets.LXD_INFRA_IMAGES_KEY }}"
10 changes: 8 additions & 2 deletions .github/workflows/image-archlinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ name: Build ArchLinux Images

on:
workflow_dispatch:
workflow_call:
inputs:
publish:
type: boolean
default: false
description: Publish built image
workflow_call:
inputs:
publish:
type: boolean
default: true
description: Publish built image

jobs:
archlinux:
Expand Down Expand Up @@ -97,5 +102,6 @@ jobs:
uses: ./.github/actions/image-upload
if: inputs.publish == true
with:
name: "${{ env.distro }}-${{ matrix.release }}-${{ matrix.architecture }}-${{ matrix.variant }}"
target: ${{ env.target }}
image_dir: "${{ env.distro }}/${{ matrix.release }}/${{ matrix.architecture }}/${{ matrix.variant }}"
ssh_private_key: "${{ secrets.LXD_INFRA_IMAGES_KEY }}"
10 changes: 8 additions & 2 deletions .github/workflows/image-busybox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ name: Build BusyBox Images

on:
workflow_dispatch:
workflow_call:
inputs:
publish:
type: boolean
default: false
description: Publish built image
workflow_call:
inputs:
publish:
type: boolean
default: true
description: Publish built image

jobs:
busybox:
Expand Down Expand Up @@ -73,5 +78,6 @@ jobs:
uses: ./.github/actions/image-upload
if: inputs.publish == true
with:
name: "${{ env.distro }}-${{ matrix.release }}-${{ matrix.architecture }}-${{ matrix.variant }}"
target: ${{ env.target }}
image_dir: "${{ env.distro }}/${{ matrix.release }}/${{ matrix.architecture }}/${{ matrix.variant }}"
ssh_private_key: "${{ secrets.LXD_INFRA_IMAGES_KEY }}"
10 changes: 8 additions & 2 deletions .github/workflows/image-centos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ name: Build CentOS Images

on:
workflow_dispatch:
workflow_call:
inputs:
publish:
type: boolean
default: false
description: Publish built image
workflow_call:
inputs:
publish:
type: boolean
default: true
description: Publish built image

jobs:
centos:
Expand Down Expand Up @@ -107,5 +112,6 @@ jobs:
uses: ./.github/actions/image-upload
if: inputs.publish == true
with:
name: "${{ env.distro }}-${{ matrix.release }}-${{ matrix.architecture }}-${{ matrix.variant }}"
target: ${{ env.target }}
image_dir: "${{ env.distro }}/${{ matrix.release }}/${{ matrix.architecture }}/${{ matrix.variant }}"
ssh_private_key: "${{ secrets.LXD_INFRA_IMAGES_KEY }}"
10 changes: 8 additions & 2 deletions .github/workflows/image-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ name: Build Debian Images

on:
workflow_dispatch:
workflow_call:
inputs:
publish:
type: boolean
default: false
description: Publish built image
workflow_call:
inputs:
publish:
type: boolean
default: true
description: Publish built image

jobs:
debian:
Expand Down Expand Up @@ -87,5 +92,6 @@ jobs:
uses: ./.github/actions/image-upload
if: inputs.publish == true
with:
name: "${{ env.distro }}-${{ matrix.release }}-${{ matrix.architecture }}-${{ matrix.variant }}"
target: ${{ env.target }}
image_dir: "${{ env.distro }}/${{ matrix.release }}/${{ matrix.architecture }}/${{ matrix.variant }}"
ssh_private_key: "${{ secrets.LXD_INFRA_IMAGES_KEY }}"
11 changes: 8 additions & 3 deletions .github/workflows/image-devuan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ name: Build Devuan Images

on:
workflow_dispatch:
workflow_call:
inputs:
publish:
type: boolean
default: false
description: Publish built image
workflow_call:
inputs:
publish:
type: boolean
default: true
description: Publish built image

jobs:
devuan:
Expand Down Expand Up @@ -77,6 +82,6 @@ jobs:
uses: ./.github/actions/image-upload
if: inputs.publish == true
with:
name: "${{ env.distro }}-${{ matrix.release }}-${{ matrix.architecture }}-${{ matrix.variant }}"
target: ${{ env.target }}
# types: ${{ env.type }}
image_dir: "${{ env.distro }}/${{ matrix.release }}/${{ matrix.architecture }}/${{ matrix.variant }}"
ssh_private_key: "${{ secrets.LXD_INFRA_IMAGES_KEY }}"
10 changes: 8 additions & 2 deletions .github/workflows/image-fedora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ name: Build Fedora Images

on:
workflow_dispatch:
workflow_call:
inputs:
publish:
type: boolean
default: false
description: Publish built image
workflow_call:
inputs:
publish:
type: boolean
default: true
description: Publish built image

jobs:
fedora:
Expand Down Expand Up @@ -88,5 +93,6 @@ jobs:
uses: ./.github/actions/image-upload
if: inputs.publish == true
with:
name: "${{ env.distro }}-${{ matrix.release }}-${{ matrix.architecture }}-${{ matrix.variant }}"
target: ${{ env.target }}
image_dir: "${{ env.distro }}/${{ matrix.release }}/${{ matrix.architecture }}/${{ matrix.variant }}"
ssh_private_key: "${{ secrets.LXD_INFRA_IMAGES_KEY }}"
10 changes: 8 additions & 2 deletions .github/workflows/image-funtoo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ name: Build Funtoo Images

on:
workflow_dispatch:
workflow_call:
inputs:
publish:
type: boolean
default: false
description: Publish built image
workflow_call:
inputs:
publish:
type: boolean
default: true
description: Publish built image

jobs:
funtoo:
Expand Down Expand Up @@ -78,5 +83,6 @@ jobs:
uses: ./.github/actions/image-upload
if: inputs.publish == true
with:
name: "${{ env.distro }}-${{ matrix.release }}-${{ matrix.architecture }}-${{ matrix.variant }}"
target: ${{ env.target }}
image_dir: "${{ env.distro }}/${{ matrix.release }}/${{ matrix.architecture }}/${{ matrix.variant }}"
ssh_private_key: "${{ secrets.LXD_INFRA_IMAGES_KEY }}"
10 changes: 8 additions & 2 deletions .github/workflows/image-gentoo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ name: Build Gentoo Images

on:
workflow_dispatch:
workflow_call:
inputs:
publish:
type: boolean
default: false
description: Publish built image
workflow_call:
inputs:
publish:
type: boolean
default: true
description: Publish built image

jobs:
gentoo:
Expand Down Expand Up @@ -82,5 +87,6 @@ jobs:
uses: ./.github/actions/image-upload
if: inputs.publish == true
with:
name: "${{ env.distro }}-${{ matrix.release }}-${{ matrix.architecture }}-${{ matrix.variant }}"
target: ${{ env.target }}
image_dir: "${{ env.distro }}/${{ matrix.release }}/${{ matrix.architecture }}/${{ matrix.variant }}"
ssh_private_key: "${{ secrets.LXD_INFRA_IMAGES_KEY }}"
10 changes: 8 additions & 2 deletions .github/workflows/image-kali.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ name: Build Kali Images

on:
workflow_dispatch:
workflow_call:
inputs:
publish:
type: boolean
default: false
description: Publish built image
workflow_call:
inputs:
publish:
type: boolean
default: true
description: Publish built image

jobs:
kali:
Expand Down Expand Up @@ -75,5 +80,6 @@ jobs:
uses: ./.github/actions/image-upload
if: inputs.publish == true
with:
name: "${{ env.distro }}-${{ matrix.release }}-${{ matrix.architecture }}-${{ matrix.variant }}"
target: ${{ env.target }}
image_dir: "${{ env.distro }}/${{ matrix.release }}/${{ matrix.architecture }}/${{ matrix.variant }}"
ssh_private_key: "${{ secrets.LXD_INFRA_IMAGES_KEY }}"
10 changes: 8 additions & 2 deletions .github/workflows/image-nixos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ name: Build NixOS Images

on:
workflow_dispatch:
workflow_call:
inputs:
publish:
type: boolean
default: false
description: Publish built image
workflow_call:
inputs:
publish:
type: boolean
default: true
description: Publish built image

jobs:
nixos:
Expand Down Expand Up @@ -78,5 +83,6 @@ jobs:
uses: ./.github/actions/image-upload
if: inputs.publish == true
with:
name: "${{ env.distro }}-${{ matrix.release }}-${{ matrix.architecture }}-${{ matrix.variant }}"
target: ${{ env.target }}
image_dir: "${{ env.distro }}/${{ matrix.release }}/${{ matrix.architecture }}/${{ matrix.variant }}"
ssh_private_key: "${{ secrets.LXD_INFRA_IMAGES_KEY }}"
Loading

0 comments on commit 26d50af

Please sign in to comment.