Skip to content

Commit 2ad62b8

Browse files
committed
[github]: build
1 parent e4d1e78 commit 2ad62b8

File tree

1 file changed

+125
-22
lines changed

1 file changed

+125
-22
lines changed

.github/workflows/release.yml

Lines changed: 125 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 🛠️ Main
2-
run-name: 🚀 Deploy de versão
2+
run-name: 🚀 Version Deployment
33

44
on:
55
push:
@@ -11,73 +11,176 @@ env:
1111
DOCKER_IMAGE_NAME: ${{ github.repository }}
1212

1313
jobs:
14-
docker-build:
15-
name: 🐳 Build e Push
16-
runs-on: ubuntu-latest
14+
docker-build-amd64:
15+
name: 🐳 Build and Push (AMD64)
16+
runs-on: ubuntu-24.04
1717
permissions:
1818
contents: read
1919
packages: write
2020

2121
steps:
22-
- name: 📥 Checkout código
22+
- name: 📥 Checkout code
2323
uses: actions/checkout@v4
2424

25-
- name: 🏷️ Extrair versão da tag
25+
- name: 🏷️ Extract version from tag
2626
id: get_version
2727
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
2828

29-
- name: 🔧 Configurar QEMU
29+
- name: 🔧 Set up QEMU
3030
uses: docker/setup-qemu-action@v3
3131

32-
- name: 🛠️ Configurar Docker Buildx
32+
- name: 🛠️ Set up Docker Buildx
3333
uses: docker/setup-buildx-action@v3
34+
35+
- name: 📋 Extract Docker metadata
36+
id: meta
37+
uses: docker/metadata-action@v5
38+
with:
39+
images: |
40+
${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
41+
${{ env.DOCKERHUB_REPOSITORY }}
42+
tags: |
43+
type=semver,pattern={{version}}
44+
type=semver,pattern={{major}}.{{minor}}
45+
type=sha
46+
flavor: |
47+
suffix=-amd64
48+
49+
- name: 🔐 Log in to GitHub Registry
50+
uses: docker/login-action@v3
51+
with:
52+
registry: ${{ env.DOCKER_REGISTRY }}
53+
username: ${{ github.actor }}
54+
password: ${{ secrets.GITHUB_TOKEN }}
55+
56+
- name: 🏗️ Build and Push (AMD64)
57+
uses: docker/build-push-action@v5
3458
with:
35-
platforms: linux/amd64,linux/arm64,linux/arm/v7
59+
context: .
60+
platforms: linux/amd64
61+
push: true
62+
tags: ${{ steps.meta.outputs.tags }}
63+
labels: ${{ steps.meta.outputs.labels }}
64+
cache-from: type=gha,scope=amd64
65+
cache-to: type=gha,mode=max,scope=amd64
66+
67+
docker-build-arm64:
68+
name: 🐳 Build and Push (ARM64)
69+
runs-on: ubuntu-24.04-arm
70+
permissions:
71+
contents: read
72+
packages: write
73+
74+
steps:
75+
- name: 📥 Checkout code
76+
uses: actions/checkout@v4
77+
78+
- name: 🏷️ Extract version from tag
79+
id: get_version
80+
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
3681

37-
- name: 📋 Extrair metadata Docker
82+
- name: 🛠️ Set up Docker Buildx
83+
uses: docker/setup-buildx-action@v3
84+
85+
- name: 📋 Extract Docker metadata
3886
id: meta
3987
uses: docker/metadata-action@v5
4088
with:
41-
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
89+
images: |
90+
${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
91+
${{ env.DOCKERHUB_REPOSITORY }}
4292
tags: |
4393
type=semver,pattern={{version}}
4494
type=semver,pattern={{major}}.{{minor}}
4595
type=sha
96+
flavor: |
97+
suffix=-arm64
4698
47-
- name: 🔐 Login no Registry
99+
- name: 🔐 Log in to GitHub Registry
48100
uses: docker/login-action@v3
49101
with:
50102
registry: ${{ env.DOCKER_REGISTRY }}
51103
username: ${{ github.actor }}
52104
password: ${{ secrets.GITHUB_TOKEN }}
53105

54-
- name: 🏗️ Build e Push
106+
- name: 🏗️ Build and Push (ARM64)
55107
uses: docker/build-push-action@v5
56108
with:
57109
context: .
58-
platforms: linux/amd64,linux/arm64,linux/arm/v7
110+
platforms: linux/arm64
59111
push: true
60112
tags: ${{ steps.meta.outputs.tags }}
61113
labels: ${{ steps.meta.outputs.labels }}
62-
cache-from: type=gha
63-
cache-to: type=gha,mode=max
114+
cache-from: type=gha,scope=arm64
115+
cache-to: type=gha,mode=max,scope=arm64
116+
117+
docker-manifest:
118+
name: 🔗 Create Multi-Platform Manifest
119+
runs-on: ubuntu-24.04
120+
needs: [docker-build-amd64, docker-build-arm64]
121+
permissions:
122+
contents: read
123+
packages: write
124+
125+
steps:
126+
- name: 📥 Checkout code
127+
uses: actions/checkout@v4
128+
129+
- name: 🏷️ Extract version from tag
130+
id: get_version
131+
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
132+
133+
- name: 📋 Extract Docker metadata
134+
id: meta
135+
uses: docker/metadata-action@v5
136+
with:
137+
images: |
138+
${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
139+
${{ env.DOCKERHUB_REPOSITORY }}
140+
tags: |
141+
type=semver,pattern={{version}}
142+
type=semver,pattern={{major}}.{{minor}}
143+
type=sha
144+
145+
- name: 🔐 Log in to GitHub Registry
146+
uses: docker/login-action@v3
147+
with:
148+
registry: ${{ env.DOCKER_REGISTRY }}
149+
username: ${{ github.actor }}
150+
password: ${{ secrets.GITHUB_TOKEN }}
151+
152+
- name: 🛠️ Set up Docker Buildx
153+
uses: docker/setup-buildx-action@v3
154+
155+
- name: 🔗 Create and Push Multi-Platform Manifest
156+
run: |
157+
# Extract the main tags (without suffixes)
158+
TAGS="${{ steps.meta.outputs.tags }}"
159+
160+
for tag in $TAGS; do
161+
echo "Creating manifest for $tag"
162+
docker buildx imagetools create \
163+
--tag $tag \
164+
$tag-amd64 \
165+
$tag-arm64
166+
done
64167
65168
publish-release:
66-
name: 📦 Publicar Release
67-
runs-on: ubuntu-latest
68-
needs: docker-build
169+
name: 📦 Publish Release
170+
runs-on: ubuntu-24.04
171+
needs: [docker-build-amd64, docker-build-arm64, docker-manifest]
69172
permissions:
70173
contents: write
71174

72175
steps:
73-
- name: 📥 Checkout código
176+
- name: 📥 Checkout code
74177
uses: actions/checkout@v4
75178

76-
- name: 🏷️ Extrair versão da tag
179+
- name: 🏷️ Extract version from tag
77180
id: get_version
78181
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
79182

80-
- name: 📝 Criar Release
183+
- name: 📝 Create Release
81184
uses: softprops/action-gh-release@v1
82185
with:
83186
name: "🎉 Release v${{ steps.get_version.outputs.VERSION }}"

0 commit comments

Comments
 (0)