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
95 changes: 95 additions & 0 deletions .github/workflows/modules-docker-build-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
# Workflow do GitHub Actions para criar e publicar uma imagem Docker no Docker Hub.
#
# IMPORTANTE: Este workflow é chamado por outros workflows e está
# centralizado aqui para facilitar a manutenção entre módulos. Por isso, certifique-se de não introduzir
# mudanças que quebrem a compatibilidade ao modificar este workflow.

name: "modules-docker-build-push"

on:
workflow_call:
inputs:
image_name:
description: "Nome da imagem Docker (ex: gersonrs/minha-app)"
required: true
type: string
context:
description: "Contexto do Docker build (diretório do Dockerfile)"
required: false
type: string
default: "."
dockerfile:
description: "Caminho para o Dockerfile"
required: false
type: string
default: "Dockerfile"
platforms:
description: "Plataformas para build multi-arch (ex: linux/amd64,linux/arm64)"
required: false
type: string
default: "linux/amd64"
secrets:
DOCKERHUB_USERNAME:
description: "Username do Docker Hub"
required: true
DOCKERHUB_TOKEN:
description: "Token de acesso do Docker Hub"
required: true

permissions:
id-token: write
packages: write
contents: read
attestations: write

env:
REGISTRY: docker.io

jobs:
docker:
runs-on: ubuntu-latest
# Pula o build se o PR foi criado pelo release-please
if: |
github.event_name != 'pull_request' ||
!startsWith(github.head_ref, 'release-please--')
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ inputs.image_name }}
tags: |
type=ref,event=tag
type=ref,event=pr
type=sha,prefix=

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
id: push
uses: docker/build-push-action@v6
with:
context: ${{ inputs.context }}
file: ${{ inputs.context }}/${{ inputs.dockerfile }}
platforms: ${{ inputs.platforms }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
cache-from: type=gha
cache-to: type=gha,mode=max
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ examples/*/terraform.tfstate.*
examples/*/.terraform.tfstate.lock.info
examples/*/*-config
examples/*/.terraform.lock.hcl
examples/*/*.tfvars


### Files and folders when building the website and documentation locally ###
Expand Down Expand Up @@ -57,3 +58,7 @@ ehthumbs_vista.db

# Folder config file
[Dd]esktop.ini

id_ed25519
copilot-instructions.md
tfplan
2 changes: 1 addition & 1 deletion examples/kind/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resource "random_password" "airflow_fernetKey" {
special = false
}
locals {
kubernetes_version = "v1.29.2"
kubernetes_version = "v1.35.0"
cluster_name = "kind"
base_domain = format("%s.nip.io", replace(module.traefik.external_ip, ".", "-"))
subdomain = "apps"
Expand Down
Loading