Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Gradle Build

on: [push, pull_request]
on: [workflow_dispatch]

jobs:
build:
Expand Down
28 changes: 23 additions & 5 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ name: Docker Image CI

on:
push:
branches: [ "daniel-koala" ]
branches: [ "daniel-koala", "adam", "bisha" ]
pull_request:
branches: [ "daniel-koala" ]
branches: [ "daniel-koala", "adam", "bisha" ]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
Expand All @@ -21,6 +20,25 @@ jobs:
steps:
- uses: actions/checkout@v5

- name: Set image name from branch
id: image-name
run: |
declare -A BRANCH_MAP
BRANCH_MAP[daniel-koala]="code-tracking-qa"
BRANCH_MAP[adam]="code-tracking-emote"
BRANCH_MAP[bisha]="code-tracking-ai"

BRANCH="${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}"
IMAGE_NAME="${BRANCH_MAP[$BRANCH]}"

if [ -z "$IMAGE_NAME" ]; then
echo "No image mapping for branch: $BRANCH"
exit 1
fi

REPO_OWNER="${{ github.repository_owner }}"
echo "image_name=${REPO_OWNER,,}/${IMAGE_NAME}" >> "$GITHUB_OUTPUT"

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

Expand All @@ -35,12 +53,12 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: ${{ env.REGISTRY }}/${{ steps.image-name.outputs.image_name }}
tags: |
type=sha
type=ref,event=branch
type=ref,event=pr
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/daniel-koala' }}
type=raw,value=latest

- name: Build and push Docker image
uses: docker/build-push-action@v6
Expand Down
Loading