Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
hairyhum committed Apr 19, 2024
1 parent 24ef9e2 commit e0907aa
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/build_docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build docker image

on:
workflow_call:
inputs:
image_file:
required: true
type: string
image_name:
required: true
type: string
image_tag:
required: true
type: string
ref:
required: true
type: string
build-args:
required: true
type: string
extra-tags:
required: false
type: string

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ inputs.image_name }}

release_example_docker_images:
runs-on: ubuntu-latest
needs: release_packages
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
ref: ${{ inputs.ref }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Image metadata
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha
{{date 'YYYY.MM.DD-HHmm'}}
${{ inputs.image_tag }}
${{ inputs.extra-tags }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ${{ inputs.image_file }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: ${{ fromJson(inputs.build-args) }}



20 changes: 20 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: test

on:
workflow_dispatch:
inputs:
release_tag:
description: 'Image tag in the format x.x.x(-rcx)'
required: true
type: string

jobs:
build_cassandra:
uses: ./.github/workflows/build_docker.yaml
with:
image_file: docker/cassandra/Dockerfile
image_name: kanisterio/cassandra
image_tag: ${{ inputs.release_tag }}
ref: ${{ inputs.release_tag }}
build-args: |
TOOLS_IMAGE=ghcr.io/kanisterio/kanister-tools:${{ inputs.release_tag }}

0 comments on commit e0907aa

Please sign in to comment.