Skip to content

Commit 668ad18

Browse files
committed
chore: pipeline CI multi-arch + release notes
1 parent e6cbd15 commit 668ad18

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
1+
# .github/workflows/ci.yml
12
name: CI (Build & Push Docker, Update Release)
23

34
on:
45
push:
56
branches: [ "main" ]
6-
tags: [ "v*.*.*" ]
7+
tags: [ "v*.*.*" ]
78
workflow_dispatch: {}
89

910
env:
1011
REGISTRY: docker.io
11-
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/gabs-redis-langcache # ajuste se necessário
12+
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/gabs-redis-langcache
1213
DOCKERFILE: ./Dockerfile
1314

1415
jobs:
1516
build-and-push:
16-
name: Build & Push to Docker Hub
17+
name: Build & Push (multi-arch) to Docker Hub + Release on tags
1718
runs-on: ubuntu-latest
1819
permissions:
19-
contents: write # para criar/atualizar Release em tags
20+
contents: write # necessário para criar/atualizar Release quando for tag
2021
steps:
2122
- name: Checkout
2223
uses: actions/checkout@v4
2324

25+
# QEMU para build multi-arquitetura (amd64 + arm64)
26+
- name: Set up QEMU
27+
uses: docker/setup-qemu-action@v3
28+
2429
- name: Set up Docker Buildx
2530
uses: docker/setup-buildx-action@v3
2631

@@ -31,7 +36,7 @@ jobs:
3136
username: ${{ secrets.DOCKERHUB_USERNAME }}
3237
password: ${{ secrets.DOCKERHUB_TOKEN }}
3338

34-
# IMPORTANTE: garante que nenhum DOCKER_CONTEXT indesejado atrapalhe
39+
# Evita conflito com variável DOCKER_CONTEXT do Docker
3540
- name: Sanitize Docker context env
3641
run: echo "DOCKER_CONTEXT=" >> $GITHUB_ENV
3742

@@ -50,20 +55,21 @@ jobs:
5055
org.opencontainers.image.source=${{ github.repository }}
5156
org.opencontainers.image.revision=${{ github.sha }}
5257
53-
- name: Build & Push
58+
- name: Build & Push (linux/amd64, linux/arm64)
5459
id: build
5560
uses: docker/build-push-action@v6
5661
with:
57-
context: . # <- use o path aqui, não em env
62+
context: .
5863
file: ${{ env.DOCKERFILE }}
5964
push: true
60-
labels: ${{ steps.meta.outputs.labels }}
65+
platforms: linux/amd64,linux/arm64
6166
tags: ${{ steps.meta.outputs.tags }}
67+
labels: ${{ steps.meta.outputs.labels }}
6268
cache-from: type=gha
6369
cache-to: type=gha,mode=max
6470
provenance: false
6571

66-
# em tags tipo v1.2.3: cria/atualiza Release
72+
# Somente em tags (ex.: v1.2.3): cria/atualiza Release no GitHub
6773
- name: Compose release notes
6874
if: startsWith(github.ref, 'refs/tags/')
6975
id: notes
@@ -81,6 +87,10 @@ jobs:
8187
echo "### Digest"
8288
echo "\`${DIGEST}\`"
8389
echo ""
90+
echo "### Plataformas"
91+
echo "- linux/amd64"
92+
echo "- linux/arm64"
93+
echo ""
8494
echo "### Commit"
8595
echo "\`${GITHUB_SHA}\`"
8696
} > release-notes.md
@@ -94,4 +104,4 @@ jobs:
94104
body_path: release-notes.md
95105
generate_release_notes: true
96106
env:
97-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}git status

0 commit comments

Comments
 (0)