-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add GitHub Actions workflow for building and pushing Docker image
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |