Skip to content

Commit

Permalink
ci release
Browse files Browse the repository at this point in the history
  • Loading branch information
rigazilla committed Sep 13, 2024
1 parent 4197a34 commit 882d136
Showing 1 changed file with 115 additions and 0 deletions.
115 changes: 115 additions & 0 deletions .github/workflows/on_call_do_publish_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: CI Release Images

on:
workflow_call:
inputs:
repository:
description: 'Name of the repo to download server artifact from'
type: string
run-id:
description: 'Id of the run to download server artifact from'
type: string
art-name:
description: 'Artifact name to download'
type: string
tags:
description: 'Tags for the image'
type: string
push:
description: 'If true push image.'
default: true
type: boolean

branch:
description: 'infinispan-image branch to checkout.'
default: main
type: string
secrets:
token:
required: true
description: 'GH token'
quay_user:
required: true
quay_pass:
required: true
workflow_dispatch:
inputs:
repository:
description: 'Name of the repo to download server artifact from'
type: string
run-id:
description: 'Id of the run to download server artifact from'
type: string
art-name:
description: 'Artifact name to download'
type: string
tags:
description: 'Tags for the image'
type: string
push:
description: 'If true push image.'
default: true
type: boolean
branch:
description: 'infinispan-image branch to checkout.'
default: main
type: string

jobs:
image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: 'infinispan/infinispan-images'
ref: ${{ inputs.branch }}

- name: Download Artifact
uses: actions/[email protected]
with:
repository: '${{ inputs.repository }}'
run-id: '${{ inputs.run-id }}'
name: '${{ inputs.art-name }}'
github-token: ${{ secrets.token }}

- name: Unzip Artifact
id: unzip_artifact
run: |
echo "serverzip=$(ls infinispan-server-*.zip)" >> $GITHUB_OUTPUT
- name: Install CEKit
uses: cekit/[email protected]

- name: Create Dockerfile
env:
SERVER_ZIP: ${{ steps.unzip_artifact.outputs.serverzip }}
TAGS: ${{ inputs.tags }}
run: |
pwd
ls
SERVER_OVERRIDE="{\"artifacts\":[{\"name\":\"server\",\"path\":\"${GITHUB_WORKSPACE}/${SERVER_ZIP}\"}]}"
TAG="${TAGS%%,*}"
IMG_NAME="${TAG%%:*}"
IMG_VER="${TAG##*:}"
cekit -v --descriptor server-openjdk.yaml build --overrides '{"version": "'${IMG_VER}'", "name": "'${IMG_NAME}'"}' --overrides ${SERVER_OVERRIDE} --dry-run docker
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Quay
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.quay_user }}
password: ${{ secrets.quay_pass }}

- name: Build
uses: docker/build-push-action@v3
with:
context: ./target/image
platforms: linux/amd64
pull: true
push: ${{ inputs.push }}
file: target/image/Dockerfile
tags: ${{ inputs.tags }}
load: true

0 comments on commit 882d136

Please sign in to comment.