Skip to content

Commit

Permalink
add GitHub Actions workflow for building and pushing Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigor committed Dec 10, 2024
1 parent 5d1823c commit 4b8649b
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Push Docker Image

on:
push:
branches:
- main
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
# Etapa 1: Checkout do código
- name: Checkout code
uses: actions/checkout@v2

# Etapa 2: Configurar Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

# Etapa 3: Login no GitHub Container Registry (GHCR)
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: rodrigor
password: ${{ secrets.GHCR_TOKEN }}

# Etapa 4: Construir e enviar a imagem Docker para o GHCR
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
push: true
tags: ghcr.io/rodrigor/embaralhado_indigena:latest

# Etapa 5: Logout do GHCR
- name: Log out from GitHub Container Registry
run: docker logout ghcr.io

# Etapa 6: Gatilho para implantar no Portainer
#- name: Trigger Portainer Deployment
# run: curl -X POST ${{ secrets.PORTAINER_ESPRESSO_BOT_WEBHOOK_URL }}

0 comments on commit 4b8649b

Please sign in to comment.