build-sd-images.yml: Don't skip everything on push event

This commit is contained in:
thecalcaholic 2022-08-14 16:21:32 +02:00
parent b2ed8de68c
commit 939a373654

View File

@ -26,6 +26,11 @@ on:
description: 'Run curl-installer/upgrade tests?'
required: false
default: true
release:
type: boolean
description: 'Release images to GH and docker registry'
required: false
default: false
push:
tags: ["v*"]
branches:
@ -36,28 +41,28 @@ permissions:
jobs:
lxd:
if: ${{ inputs.lxd }}
if: ${{ inputs.lxd || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/build-lxd.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
secrets: inherit
docker:
if: ${{ inputs.docker }}
if: ${{ inputs.docker || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/build-docker.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
secrets: inherit
test-curl-installer:
if: ${{ inputs.installer }}
if: ${{ inputs.installer || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/vm-tests.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
secrets: inherit
raspberrypi:
if: ${{ inputs.sd-images }}
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/build-sd-images.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
@ -66,7 +71,7 @@ jobs:
secrets: inherit
odroidxu4:
if: ${{ inputs.sd-images }}
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/build-sd-images.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
@ -74,7 +79,7 @@ jobs:
board_name: OdroidHC2
secrets: inherit
rockpro64:
if: ${{ inputs.sd-images }}
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/build-sd-images.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
@ -82,7 +87,7 @@ jobs:
board_name: RockPro64
secrets: inherit
rock64:
if: ${{ inputs.sd-images }}
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/build-sd-images.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
@ -90,7 +95,7 @@ jobs:
board_name: Rock64
secrets: inherit
bananapi:
if: ${{ inputs.sd-images }}
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/build-sd-images.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
@ -98,7 +103,7 @@ jobs:
board_name: BananaPi
secrets: inherit
odroidhc4:
if: ${{ inputs.sd-images }}
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/build-sd-images.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
@ -106,7 +111,7 @@ jobs:
board_name: OdroidHC4
secrets: inherit
odroidc4:
if: ${{ inputs.sd-images }}
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/build-sd-images.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
@ -114,7 +119,7 @@ jobs:
board_name: OdroidC4
secrets: inherit
odroidc2:
if: ${{ inputs.sd-images }}
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/build-sd-images.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
@ -127,7 +132,7 @@ jobs:
needs:
- github-release
- lxd
if: ${{ inputs.lxd }}
if: ${{ inputs.lxd || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
@ -140,7 +145,7 @@ jobs:
needs:
- raspberrypi
- github-release
if: ${{ inputs.sd-images }}
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
@ -153,7 +158,7 @@ jobs:
needs:
- odroidxu4
- github-release
if: ${{ inputs.sd-images }}
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
@ -165,7 +170,7 @@ jobs:
needs:
- rockpro64
- github-release
if: ${{ inputs.sd-images }}
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
@ -177,7 +182,7 @@ jobs:
needs:
- rock64
- github-release
if: ${{ inputs.sd-images }}
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
@ -189,7 +194,7 @@ jobs:
needs:
- bananapi
- github-release
if: ${{ inputs.sd-images }}
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
@ -201,7 +206,7 @@ jobs:
needs:
- odroidhc4
- github-release
if: ${{ inputs.sd-images }}
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
@ -213,7 +218,7 @@ jobs:
needs:
- odroidc4
- github-release
if: ${{ inputs.sd-images }}
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
@ -225,7 +230,7 @@ jobs:
needs:
- odroidc2
- github-release
if: ${{ inputs.sd-images }}
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/publish-image.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
@ -238,7 +243,7 @@ jobs:
needs:
- docker
- test-curl-installer
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' && github.ref_protected }}
if: ${{ (inputs.release || github.event_name != 'workflow_dispatch') && github.ref_type == 'tag' && github.ref_protected }}
runs-on: ubuntu-latest
steps:
- name: Login to DockerHub
@ -295,7 +300,7 @@ jobs:
with:
ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
- name: Create Draft
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' && github.ref_protected }}
if: ${{ (inputs.release || github.event_name != 'workflow_dispatch') && github.ref_type == 'tag' && github.ref_protected }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: ./release