Some checks failed
Build (develop) / Promote (main) / build-and-push-deploy (push) Failing after 6s
32 lines
1015 B
YAML
32 lines
1015 B
YAML
name: Build (develop) / Promote (main)
|
|
on:
|
|
push:
|
|
branches: [main, develop, homolog]
|
|
|
|
jobs:
|
|
build-and-push-deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Push to Gitea Registry
|
|
run: |
|
|
# Define Image Name (removes https:// and converts to lowercase)
|
|
IMAGE="git.simplifiquehc.com.br/${{ gitea.repository }}"
|
|
IMAGE_LOWER=$(echo "$IMAGE" | tr '[:upper:]' '[:lower:]')
|
|
|
|
# Login to Gitea Registry (using the domain)
|
|
echo "${{ secrets.GITEA }}" | docker login git.simplifiquehc.com.br -u "${{ gitea.actor }}" --password-stdin
|
|
|
|
# Build and Push
|
|
docker build -t "$IMAGE_LOWER:latest" .
|
|
docker push "$IMAGE_LOWER:latest"
|
|
|
|
# Optional: Use SHA tag as well
|
|
TAG=$(echo ${{ gitea.sha }} | cut -c1-7)
|
|
docker tag "$IMAGE_LOWER:latest" "$IMAGE_LOWER:$TAG"
|
|
docker push "$IMAGE_LOWER:$TAG"
|