Skip to content

Commit bad683c

Browse files
committed
feat: new cache optimization #release
1 parent 66f5655 commit bad683c

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# .github/workflows/ci.yml
12
name: CI (Build & Push Docker + Auto Release)
23

34
on:
@@ -12,7 +13,7 @@ env:
1213
DOCKERFILE: ./Dockerfile
1314

1415
permissions:
15-
contents: write
16+
contents: write # required to create and push tags
1617

1718
jobs:
1819
build-and-push:
@@ -42,12 +43,12 @@ jobs:
4243
uses: docker/metadata-action@v5
4344
with:
4445
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
45-
# 👉 Only semver tags when triggered by a tag event
46+
# 👇 Only push semver tags on tag events
4647
tags: |
4748
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/') }}
48-
type=raw,value=latest,enable=${{ github.ref_name == 'main' && !startsWith(github.ref, 'refs/tags/') }}
49-
type=ref,event=branch,enable=${{ !startsWith(github.ref, 'refs/tags/') }}
50-
type=sha,enable=${{ !startsWith(github.ref, 'refs/tags/') }}
49+
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
50+
type=ref,event=branch,enable=${{ github.ref == 'refs/heads/main' }}
51+
type=sha,enable=${{ github.ref == 'refs/heads/main' }}
5152
labels: |
5253
org.opencontainers.image.title=${{ github.event.repository.name }}
5354
org.opencontainers.image.source=${{ github.repository }}
@@ -71,7 +72,8 @@ jobs:
7172

7273
auto-release:
7374
needs: build-and-push
74-
if: contains(github.event.head_commit.message, '#release')
75+
# Fire only on main branch pushes containing '#release'
76+
if: ${{ github.ref == 'refs/heads/main' && contains(join(github.event.commits.*.message, ' '), '#release') }}
7577
runs-on: ubuntu-latest
7678
steps:
7779
- uses: actions/checkout@v4
@@ -87,7 +89,7 @@ jobs:
8789
VER=${LAST#v}
8890
IFS='.' read -r MA MI PA <<<"$VER"
8991
NEW_TAG="v$MA.$MI.$((PA+1))"
90-
echo "New tag: $NEW_TAG"
92+
echo "Creating $NEW_TAG"
9193
git config user.name "github-actions[bot]"
9294
git config user.email "github-actions[bot]@users.noreply.github.com"
9395
git tag -a "$NEW_TAG" -m "release $NEW_TAG"

main_demo_released.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ def calc_savings(tokens_est: int, price_in: float, price_out: float, frac_in: fl
595595
<div class="app-header">
596596
<div class="brand">
597597
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/Redis_logo.svg/2560px-Redis_logo.svg.png" alt="Redis">
598-
<div class="title">Redis LangCache — Demo PT-BR - SemVer: v2.0.4-harness - PR GitHub: gacerioni</div>
598+
<div class="title">Redis LangCache — Demo PT-BR - SemVer: v2.0.5-harness - PR GitHub: gacerioni</div>
599599
</div>
600600
<div class="links">
601601
<a href="https://www.linkedin.com/in/gabrielcerioni/" target="_blank" rel="noopener">💼 LinkedIn do Gabs</a>

0 commit comments

Comments
 (0)