This commit is contained in:
JurTI-BR 2025-01-30 18:07:46 -03:00
parent c8f42ec2c3
commit 62f4c767dd
1 changed files with 0 additions and 37 deletions

View File

@ -1,37 +0,0 @@
name: Docker CI/CD
on:
push:
branches: [ "main" ]
permissions:
contents: read
packages: write # Permissão para push no GHCR
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
## Converter o nome do usuário do GitHub para minúsculas
- name: Convert GitHub Username to Lowercase
run: echo "GITHUB_ACTOR_LOWER=$(echo ${{ github.actor }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
## Login no GitHub Container Registry (GHCR)
- name: Log in to GitHub Container Registry (GHCR)
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
## Build e Tag da Imagem Docker
- name: Build and Tag Docker Image
run: |
docker build -t ghcr.io/$GITHUB_ACTOR_LOWER/vendaweb:latest .
docker tag ghcr.io/$GITHUB_ACTOR_LOWER/vendaweb:latest ghcr.io/$GITHUB_ACTOR_LOWER/vendaweb:$(date +%Y%m%d%H%M)
## Push da Imagem para o GHCR
- name: Push Docker Image to GitHub Container Registry (GHCR)
run: |
docker push ghcr.io/$GITHUB_ACTOR_LOWER/vendaweb:latest
docker push ghcr.io/$GITHUB_ACTOR_LOWER/vendaweb:$(date +%Y%m%d%H%M)