Skip to content

Commit

Permalink
feat: add CircleCI and GitHub Actions workflows for Docker builds
Browse files Browse the repository at this point in the history
  • Loading branch information
kalinkrustev committed Dec 18, 2024
1 parent 3f9f0cb commit 180e597
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2.1
setup: true
orbs:
build: mojaloop/[email protected]
workflows:
setup:
jobs:
- build/workflow:
filters:
tags:
only: /v\d+(\.\d+){2}(-[a-zA-Z-][0-9a-zA-Z-]*\.\d+)?/
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!packages/k6-tests
55 changes: 55 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Docker

on:
push:
branches: [ "main", "k6-operator" ]
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "main" ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}


jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM ghcr.io/grafana/k6-operator:runner-v0.0.17
COPY packages/k6-tests /scripts
15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@mojaloop/ml-core-test-harness",
"version": "1.0.0",
"private": true,
"scripts": {
"lint": "true",
"dep:check": "true",
"audit:check": "true",
"test:xunit": "true",
"test:integration": "true",
"test:functional": "true",
"test:coverage-check": "true"
},
"license": "Apache-2.0"
}

0 comments on commit 180e597

Please sign in to comment.