Skip to content

Commit

Permalink
build tag and publish proxy service docker images on each commit to m…
Browse files Browse the repository at this point in the history
…aster
  • Loading branch information
galxy25 committed Mar 24, 2023
1 parent 8700ff9 commit 1c7af65
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/workflows/ci-docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build & Publish Docker Images

on:
workflow_call:
inputs:
dockerhub-username:
required: true
type: string
secrets:
CI_DOCKERHUB_TOKEN:
required: true

# runs in ci-main after successful checks
# you can use images built by this action in future jobs.
# https://docs.docker.com/build/ci/github-actions/examples/#share-built-image-between-jobs
jobs:
docker:
# https://github.com/marketplace/actions/build-and-push-docker-images
runs-on: ubuntu-latest
steps:
# ensure working with latest code
- name: Checkout
uses: actions/checkout@v3
# generate a git commit hash to be used as image tag
- name: Generate short hash
id: commit-hash
run: echo "short=$(date +%s )-$( git rev-parse --short $GITHUB_SHA )" >> $GITHUB_OUTPUT
# qemu is used to emulate different platform architectures
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# cross-platform build of the image
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# authenticate for publish to docker hub
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ inputs.dockerhub-username }}
password: ${{ secrets.CI_DOCKERHUB_TOKEN }}
# publish to docker hub, tag with short git hash
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./production.Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: kava/kava-proxy-service:${{ steps.commit-hash.outputs.short }},kava/kava-proxy-service:latest
7 changes: 7 additions & 0 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@ jobs:
e2e-tests:
needs: [lint-checks, default-checks]
uses: ./.github/workflows/ci-e2e-tests.yml
# build, tag and publish new service docker images
release-docker-images:
needs: [e2e-tests]
uses: ./.github/workflows/ci-docker-release.yml
with:
dockerhub-username: kavaops
secrets: inherit
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ L7 proxy that enables observability, routing, and scaling of kava APIs to the fa

## Usage

_Under Development_.
[Service Workflows](https://github.com/Kava-Labs/kava-proxy-service/blob/main/architecture/ARCHITECTURE.md#service-workflows)

### Environment Variables

Expand Down

0 comments on commit 1c7af65

Please sign in to comment.