fix: build
All checks were successful
BCards Deployment Pipeline / Run Tests (pull_request) Successful in 2s
BCards Deployment Pipeline / PR Validation (pull_request) Successful in 0s
BCards Deployment Pipeline / Build and Push Image (pull_request) Has been skipped
BCards Deployment Pipeline / Deploy to Production (ARM - OCI) (pull_request) Has been skipped
BCards Deployment Pipeline / Deploy to Staging (x86 - Local) (pull_request) Has been skipped
BCards Deployment Pipeline / Cleanup Old Resources (pull_request) Has been skipped
BCards Deployment Pipeline / Deployment Summary (pull_request) Successful in 0s
All checks were successful
BCards Deployment Pipeline / Run Tests (pull_request) Successful in 2s
BCards Deployment Pipeline / PR Validation (pull_request) Successful in 0s
BCards Deployment Pipeline / Build and Push Image (pull_request) Has been skipped
BCards Deployment Pipeline / Deploy to Production (ARM - OCI) (pull_request) Has been skipped
BCards Deployment Pipeline / Deploy to Staging (x86 - Local) (pull_request) Has been skipped
BCards Deployment Pipeline / Cleanup Old Resources (pull_request) Has been skipped
BCards Deployment Pipeline / Deployment Summary (pull_request) Successful in 0s
This commit is contained in:
parent
38c991758c
commit
ec559e8115
@ -5,8 +5,10 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- 'Release/*'
|
- 'Release/*'
|
||||||
|
# PRs apenas validam, não fazem deploy
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: registry.redecarneir.us
|
REGISTRY: registry.redecarneir.us
|
||||||
@ -66,11 +68,31 @@ jobs:
|
|||||||
if: env.TESTS_SKIPPED == 'false'
|
if: env.TESTS_SKIPPED == 'false'
|
||||||
run: dotnet test --no-build --configuration Release --verbosity normal --collect:"XPlat Code Coverage"
|
run: dotnet test --no-build --configuration Release --verbosity normal --collect:"XPlat Code Coverage"
|
||||||
|
|
||||||
|
# Job específico para validação de PRs (sem deploy)
|
||||||
|
pr-validation:
|
||||||
|
name: PR Validation
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [test]
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: PR Validation Summary
|
||||||
|
run: |
|
||||||
|
echo "✅ Pull Request Validation Summary"
|
||||||
|
echo "🎯 Target Branch: ${{ github.base_ref }}"
|
||||||
|
echo "📂 Source Branch: ${{ github.head_ref }}"
|
||||||
|
echo "🧪 Tests: ${{ needs.test.result }}"
|
||||||
|
echo "👤 Author: ${{ github.event.pull_request.user.login }}"
|
||||||
|
echo "📝 Title: ${{ github.event.pull_request.title }}"
|
||||||
|
echo ""
|
||||||
|
echo "✨ PR está pronto para merge!"
|
||||||
|
|
||||||
build-and-push:
|
build-and-push:
|
||||||
name: Build and Push Image
|
name: Build and Push Image
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [test]
|
needs: [test]
|
||||||
if: always() && (needs.test.result == 'success' || needs.test.result == 'skipped')
|
# Só faz build/push em push (não em PR)
|
||||||
|
if: github.event_name == 'push' && (needs.test.result == 'success' || needs.test.result == 'skipped')
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@ -111,20 +133,25 @@ jobs:
|
|||||||
SHORT_COMMIT=${COMMIT_SHA:0:7}
|
SHORT_COMMIT=${COMMIT_SHA:0:7}
|
||||||
echo "commit=$SHORT_COMMIT" >> $GITHUB_OUTPUT
|
echo "commit=$SHORT_COMMIT" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
echo "📦 Tag: $(echo '${{ steps.settings.outputs.tag }}')"
|
echo "📦 Tag: ${{ steps.settings.outputs.tag }}"
|
||||||
echo "🏗️ Platform: $(echo '${{ steps.settings.outputs.platform }}')"
|
echo "🏗️ Platform: ${{ steps.settings.outputs.platform }}"
|
||||||
echo "🌍 Environment: $(echo '${{ steps.settings.outputs.environment }}')"
|
echo "🌍 Environment: ${{ steps.settings.outputs.environment }}"
|
||||||
echo "🎯 Target: $(echo '${{ steps.settings.outputs.deploy_target }}')"
|
echo "🎯 Target: ${{ steps.settings.outputs.deploy_target }}"
|
||||||
|
|
||||||
- name: Build and push image
|
- name: Build and push image
|
||||||
run: |
|
run: |
|
||||||
echo "🏗️ Building image for ${{ steps.settings.outputs.deploy_target }}..."
|
echo "🏗️ Building image for ${{ steps.settings.outputs.deploy_target }}..."
|
||||||
|
|
||||||
|
# Debug das variáveis
|
||||||
|
echo "Platform: ${{ steps.settings.outputs.platform }}"
|
||||||
|
echo "Dockerfile: ${{ steps.settings.outputs.dockerfile }}"
|
||||||
|
echo "Tag: ${{ steps.settings.outputs.tag }}"
|
||||||
|
|
||||||
# Build para a plataforma correta
|
# Build para a plataforma correta
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--platform ${{ steps.settings.outputs.platform }} \
|
--platform ${{ steps.settings.outputs.platform }} \
|
||||||
--file ${{ steps.settings.outputs.dockerfile }} \
|
--file ${{ steps.settings.outputs.dockerfile }} \
|
||||||
--tag $REGISTRY/$IMAGE_NAME:${{ steps.settings.outputs.tag }} \
|
--tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.settings.outputs.tag }} \
|
||||||
--push \
|
--push \
|
||||||
--build-arg VERSION=${{ steps.settings.outputs.version || 'latest' }} \
|
--build-arg VERSION=${{ steps.settings.outputs.version || 'latest' }} \
|
||||||
--build-arg COMMIT=${{ steps.settings.outputs.commit }} \
|
--build-arg COMMIT=${{ steps.settings.outputs.commit }} \
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user