Skip to content

Commit

Permalink
ISPN-16536 Workflow publish test image. Replace Jenkins stage image
Browse files Browse the repository at this point in the history
  • Loading branch information
rigazilla authored and ryanemerson committed Sep 16, 2024
1 parent 4197a34 commit efeb437
Showing 1 changed file with 115 additions and 0 deletions.
115 changes: 115 additions & 0 deletions .github/workflows/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
runId:
description: 'Id of the run to download server artifact from'
type: string
serverArtifact:
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'
quayUser:
required: true
quayPass:
required: true

workflow_dispatch:
inputs:
repository:
description: 'Name of the repo to download server artifact from'
type: string
runId:
description: 'Id of the run to download server artifact from'
type: string
serverArtifact:
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.runId }}'
name: '${{ inputs.serverArtifact }}'
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: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- 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: Login to Quay
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.quayUser }}
password: ${{ secrets.quayPass }}

- 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 efeb437

Please sign in to comment.