Skip to content

🚀 Deploy de versão #5

🚀 Deploy de versão

🚀 Deploy de versão #5

Workflow file for this run

name: 🛠️ Main
run-name: 🚀 Deploy de versão
on:
push:
tags:
- '*.*.*'
env:
DOCKER_REGISTRY: ghcr.io
DOCKER_IMAGE_NAME: ${{ github.repository }}
jobs:
docker-build:
name: 🐳 Build e Push
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: 📥 Checkout código
uses: actions/checkout@v4
- name: 🏷️ Extrair versão da tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: 🔧 Configurar QEMU
uses: docker/setup-qemu-action@v3
- name: 🛠️ Configurar Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
- name: 📋 Extrair metadata Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
- name: 🔐 Login no Registry
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🏗️ Build e Push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
publish-release:
name: 📦 Publicar Release
runs-on: ubuntu-latest
needs: docker-build
permissions:
contents: write
steps:
- name: 📥 Checkout código
uses: actions/checkout@v4
- name: 🏷️ Extrair versão da tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: 📝 Criar Release
uses: softprops/action-gh-release@v1
with:
name: "🎉 Release v${{ steps.get_version.outputs.VERSION }}"
tag_name: ${{ steps.get_version.outputs.VERSION }}
generate_release_notes: true
draft: false
prerelease: false