refactor workflows to enable multiple docker images
This commit is contained in:
parent
53cdfd70a1
commit
97ef92706b
3 changed files with 45 additions and 10 deletions
23
.github/workflows/build-and-push.yml
vendored
23
.github/workflows/build-and-push.yml
vendored
|
|
@ -1,14 +1,16 @@
|
|||
name: "Build GARM images"
|
||||
name: "Build and push GARM images"
|
||||
on:
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
inputs:
|
||||
push_to_project:
|
||||
description: "Project to build images for"
|
||||
required: true
|
||||
type: string
|
||||
default: "ghcr.io/cloudbase"
|
||||
ref:
|
||||
description: "Ref to build"
|
||||
required: true
|
||||
type: string
|
||||
default: "main"
|
||||
schedule:
|
||||
- cron: "0 2 * * *"
|
||||
|
|
@ -24,8 +26,9 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ inputs.ref }}
|
||||
path: src/github.com/cloudbase/garm
|
||||
fetch-depth: 0
|
||||
|
||||
|
|
@ -40,15 +43,12 @@ jobs:
|
|||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
env:
|
||||
REGISTRY_INPUT: ${{ inputs.push_to_project }}
|
||||
GH_REF: ${{ inputs.ref }}
|
||||
working-directory: src/github.com/cloudbase/garm
|
||||
run: |
|
||||
set -x
|
||||
REGISTRY_INPUT="${{ github.event.inputs.push_to_project }}"
|
||||
REF_INPUT="${{ github.event.inputs.ref }}"
|
||||
|
||||
PUSH_TO_PROJECT="${REGISTRY_INPUT:-ghcr.io/cloudbase}"
|
||||
GH_REF="${REF_INPUT:-main}"
|
||||
cd src/github.com/cloudbase/garm && git checkout "${GH_REF}"
|
||||
|
||||
VERSION=$(git describe --tags --match='v[0-9]*' --always)
|
||||
AZURE_REF=v0.1.0
|
||||
OPENSTACK_REF=v0.1.0
|
||||
|
|
@ -69,6 +69,9 @@ jobs:
|
|||
K8S_REF="main"
|
||||
VERSION="nightly"
|
||||
fi
|
||||
if [ "$GH_REF" == "release/v1" ]; then
|
||||
VERSION="v0.1"
|
||||
fi
|
||||
docker buildx build \
|
||||
--provenance=false \
|
||||
--platform linux/amd64,linux/arm64 \
|
||||
|
|
|
|||
19
.github/workflows/trigger-manual.yml
vendored
Normal file
19
.github/workflows/trigger-manual.yml
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
name: Manual build of GARM images
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
push_to_project:
|
||||
description: "Project to build images for"
|
||||
required: true
|
||||
default: "ghcr.io/cloudbase"
|
||||
ref:
|
||||
description: "Ref to build"
|
||||
required: true
|
||||
default: "main"
|
||||
|
||||
jobs:
|
||||
call-build-and-push:
|
||||
uses: ./.github/workflows/build-and-push.yml
|
||||
with:
|
||||
push_to_project: ${{ inputs.push_to_project }}
|
||||
ref: ${{ inputs.ref }}
|
||||
13
.github/workflows/trigger-nightly.yml
vendored
Normal file
13
.github/workflows/trigger-nightly.yml
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
name: Nightly build of GARM images
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 2 * * *"
|
||||
|
||||
jobs:
|
||||
call-build-and-push:
|
||||
uses: ./.github/workflows/build-and-push.yml
|
||||
strategy:
|
||||
matrix:
|
||||
ref: ["main", "release/v1"]
|
||||
with:
|
||||
ref: ${{ matrix.ref }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue