Skip to content

feat: baking version into CI #1

feat: baking version into CI

feat: baking version into CI #1

Workflow file for this run

name: Build and Push Python Client Image
on:
push:
branches: [master]
workflow_dispatch:
concurrency:
group: build-python-client
cancel-in-progress: false
jobs:
build-and-push:
runs-on: ubuntu-22.04-arm
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Log in to private Docker registry
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login docker.kmanning.ie:5000 -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Build and push Docker image
run: |
IMAGE=docker.kmanning.ie:5000/intercom-python-client
APP_VERSION=$(cat VERSION)
DOCKER_TAG=$(echo "$APP_VERSION" | tr '+' '-')
docker build \
--build-arg APP_VERSION="$APP_VERSION" \
-f Dockerfile \
-t "$IMAGE:latest" \
-t "$IMAGE:${{ github.sha }}" \
-t "$IMAGE:$DOCKER_TAG" \
.
docker push "$IMAGE:latest"
docker push "$IMAGE:${{ github.sha }}"
docker push "$IMAGE:$DOCKER_TAG"