mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 23:48:56 +01:00
Update tagging of the docker image on release, push to master & PR
- Tag docker image with `tag_name' on release (i.e tag push) - Else tag with 'pre' on push to master - Else tag with 'dev' on push to PR branch - Only tag the latest release with release tag Previously the latest commit on master was being tagged with the latest tag. This doesn't sync with the release cadence of the rest of Khoj
This commit is contained in:
parent
b5ae64cb3c
commit
8d1e988059
2 changed files with 10 additions and 4 deletions
7
.github/workflows/dockerize.yml
vendored
7
.github/workflows/dockerize.yml
vendored
|
@ -16,7 +16,8 @@ on:
|
|||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
DOCKER_IMAGE_TAG: ${{ github.ref == 'refs/heads/master' && 'latest' || github.ref_name }}
|
||||
# Tag Image with tag name on release, else with 'pre' if push to master
|
||||
DOCKER_IMAGE_TAG: ${{ github.ref_type == 'tag' && github.ref_name || 'pre' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
@ -47,7 +48,9 @@ jobs:
|
|||
file: Dockerfile
|
||||
platforms: linux/amd64, linux/arm64
|
||||
push: true
|
||||
tags: ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }}
|
||||
tags: |
|
||||
ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }}
|
||||
${{ github.ref_type == 'tag' && 'ghcr.io/${{ github.repository }}-cloud:latest' || '' }}
|
||||
build-args: |
|
||||
VERSION=${{ steps.hatch.outputs.version }}
|
||||
PORT=42110
|
||||
|
|
7
.github/workflows/dockerize_production.yml
vendored
7
.github/workflows/dockerize_production.yml
vendored
|
@ -20,7 +20,8 @@ on:
|
|||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
DOCKER_IMAGE_TAG: ${{ github.event_name == 'pull_request' && 'dev' || (github.ref == 'refs/heads/master' && 'latest' || github.ref_name) }}
|
||||
# Tag Image with tag name on release, else with 'pre' if push to master else with 'dev' if push to PR branch
|
||||
DOCKER_IMAGE_TAG: ${{ github.ref_type == 'tag' && github.ref_name || github.event_name == 'pull_request' && 'dev' || 'pre' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
@ -51,7 +52,9 @@ jobs:
|
|||
file: prod.Dockerfile
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }}
|
||||
tags: |
|
||||
ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }}
|
||||
${{ github.ref_type == 'tag' && 'ghcr.io/${{ github.repository }}-cloud:latest' || '' }}
|
||||
build-args: |
|
||||
VERSION=${{ steps.hatch.outputs.version }}
|
||||
PORT=42110
|
||||
|
|
Loading…
Reference in a new issue