Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add release job for kpi-tracker. #142

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/release-kpi-tracker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Publish a docker image for KPI-tracker to DockerHub.

on:
push:
tags:
- kpi-tracker/*.*.*

env:
REGISTRY: docker.io
IMAGE_NAME: kpi-tracker

jobs:
publish-docker-image:
runs-on: ubuntu-latest
environment: testnet-deployments
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
# Uses the `docker/login-action` action to log in to the Container registry.
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract version tag from Cargo.toml manifest.
id: meta
run: |
export VERSION=$(yq .package.version kpi-tracker/Cargo.toml)
export FULL_IMAGE_TAG="${{ env.REGISTRY }}/concordium/$IMAGE_NAME:$VERSION"
echo "::notice FULL_IMAGE_TAG=${FULL_IMAGE_TAG}"
# Make sure the image does not exist. Abort if we can retrieve any metadata.
if docker manifest inspect ${FULL_IMAGE_TAG} > /dev/null; then
echo "::error ${FULL_IMAGE_TAG} already exists"
exit 1
elif [ ! "${{ github.ref_name }}" = "kpi-tracker/${VERSION}" ]; then
echo "::error Expected tag ${EXPECTED_TAG} does not match the version ${VERSION}."
exit 1
else
# Store the full image tag into a tag variable for the following step.
echo "tag=${FULL_IMAGE_TAG}" > "$GITHUB_OUTPUT"
fi
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
file: ./kpi-tracker/scripts/Dockerfile
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tag }}
8 changes: 2 additions & 6 deletions kpi-tracker/scripts/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
ARG build_image
ARG base_image
ARG build_image=rust:1.74-bookworm
ARG base_image=debian:bookworm
FROM ${build_image} AS build
# Install protoc
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.15.3/protoc-3.15.3-linux-x86_64.zip
RUN unzip protoc-3.15.3-linux-x86_64.zip
RUN mv ./bin/protoc /usr/bin/protoc
abizjak marked this conversation as resolved.
Show resolved Hide resolved

WORKDIR /build
COPY ./kpi-tracker ./src
Expand Down
41 changes: 0 additions & 41 deletions kpi-tracker/scripts/Jenkinsfile

This file was deleted.