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
12 changes: 8 additions & 4 deletions .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,18 @@ jobs:
MAJOR=${BASH_REMATCH[1]}
MINOR=${BASH_REMATCH[2]}
PATCH=${BASH_REMATCH[3]}
BUILD=${BASH_REMATCH[4]}

# Docker tags: MAJOR.MINOR.PATCH and MAJOR.MINOR
PATCH_VERSION="${MAJOR}.${MINOR}.${PATCH}" # e.g., 1.27.1
MINOR_VERSION="${MAJOR}.${MINOR}" # e.g., 1.27
# Docker tags: MAJOR.MINOR.PATCH.BUILD, MAJOR.MINOR.PATCH, and MAJOR.MINOR
FULL_VERSION="${MAJOR}.${MINOR}.${PATCH}.${BUILD}" # e.g., 1.27.1.2
PATCH_VERSION="${MAJOR}.${MINOR}.${PATCH}" # e.g., 1.27.1
MINOR_VERSION="${MAJOR}.${MINOR}" # e.g., 1.27

echo "full_version=$FULL_VERSION" >> $GITHUB_OUTPUT
echo "patch_version=$PATCH_VERSION" >> $GITHUB_OUTPUT
echo "minor_version=$MINOR_VERSION" >> $GITHUB_OUTPUT

echo "Generated Docker tags: $PATCH_VERSION, $MINOR_VERSION"
echo "Generated Docker tags: $FULL_VERSION, $PATCH_VERSION, $MINOR_VERSION"
else
echo "Tag format does not match expected pattern (X.X.X.X-X)"
fi
Expand All @@ -129,6 +132,7 @@ jobs:
images: ${{ env.DOCKER_IMAGE }}
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') || github.ref == format('refs/heads/{0}', 'main') }}
type=raw,value=${{ steps.version.outputs.full_version }},enable=${{ startsWith(github.ref, 'refs/tags/') && steps.version.outputs.full_version != '' }}
type=raw,value=${{ steps.version.outputs.patch_version }},enable=${{ startsWith(github.ref, 'refs/tags/') && steps.version.outputs.patch_version != '' }}
type=raw,value=${{ steps.version.outputs.minor_version }},enable=${{ startsWith(github.ref, 'refs/tags/') && steps.version.outputs.minor_version != '' }}

Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,17 @@ When updating OpenResty or dependencies:
- Maintains complete build history

**Docker Tags** (generated automatically):
- `1.27.1.2` - Four-part version (exact build)
- `1.27.1` - Three-part version (tracks latest patch within 1.27.1.x)
- `1.27` - Two-part version (tracks latest minor)
- `latest` - Latest build from master branch

**Example**: Pushing git tag `1.27.1.2-0` generates Docker tags:
- `intimatemerger/openresty:1.27.1.2`
- `intimatemerger/openresty:1.27.1`
- `intimatemerger/openresty:1.27`
- `intimatemerger/openresty:latest`

**Note**: Four-part version tags (e.g., `1.27.1.2`) are not published to Docker Hub. Users should use `1.27.1` to get the latest patch version within the 1.27.1.x series.

## Testing

```bash
Expand Down