Make build pipeline work for us
This commit is contained in:
parent
8f1cd9f974
commit
c27d612d7d
1 changed files with 26 additions and 16 deletions
42
.github/workflows/build-and-push.yml
vendored
42
.github/workflows/build-and-push.yml
vendored
|
|
@ -1,5 +1,17 @@
|
|||
name: "Build and push GARM images"
|
||||
name: "Build and push GARM images to EDP"
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
push_to_project:
|
||||
description: "Project to build images for, defaults to DevFW-CICD"
|
||||
required: false
|
||||
type: string
|
||||
default: "edp.buildth.ing/DevFW-CICD"
|
||||
ref:
|
||||
description: "Branch/tag to build"
|
||||
required: false
|
||||
type: string
|
||||
default: "feat/forgejo"
|
||||
workflow_call:
|
||||
inputs:
|
||||
push_to_project:
|
||||
|
|
@ -11,36 +23,32 @@ on:
|
|||
description: "Ref to build"
|
||||
required: false
|
||||
type: string
|
||||
default: "main"
|
||||
default: "feat/forgejo"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
images:
|
||||
permissions:
|
||||
packages: write
|
||||
|
||||
name: "Build GARM images"
|
||||
runs-on: ubuntu-noble-garm
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
path: src/github.com/cloudbase/garm
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Docker
|
||||
uses: docker/setup-docker-action@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Docker login
|
||||
run: |
|
||||
REGISTRY="${GITHUB_SERVER_URL#https://}"
|
||||
echo "${{ secrets.PACKAGES_TOKEN }}" | docker login "$REGISTRY" -u "${{ github.repository_owner }}" --password-stdin
|
||||
echo "DOCKER_REGISTRY=$REGISTRY" >> "$GITHUB_ENV"
|
||||
echo "DOCKER_ORG=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Build and push image
|
||||
env:
|
||||
|
|
@ -50,6 +58,8 @@ jobs:
|
|||
run: |
|
||||
if [ "$GH_REF" == "main" ]; then
|
||||
IMAGE_TAG="nightly"
|
||||
elif [ "$GH_REF" == "feat/forgejo" ]; then
|
||||
IMAGE_TAG="forgejo"
|
||||
else
|
||||
IMAGE_TAG=$(git describe --tags --match='v[0-9]*' --always ${GH_REF})
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue