Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2d7b4a7
docs(blog): add post about ci/cd saga
JaegerCaiser Nov 6, 2025
28a2a61
docs: add 'verify, then act' principle to instructions
JaegerCaiser Nov 6, 2025
dc7bbce
docs(blog): add post about merge vs rebase strategies
JaegerCaiser Nov 6, 2025
f615818
docs: update copilot instructions with React 19 and CI/CD details
JaegerCaiser Nov 6, 2025
00427ce
Merge branch 'develop' into docs/add-verify-then-act-principle
JaegerCaiser Nov 6, 2025
083e5d3
Merge pull request #125 from JaegerCaiser/sync/main-to-develop
JaegerCaiser Nov 7, 2025
0967362
Merge branch 'develop' into docs/add-verify-then-act-principle
JaegerCaiser Nov 7, 2025
b723c32
fix: rename workflow jobs to prevent status check conflicts
JaegerCaiser Nov 7, 2025
7f1170e
fix: rename workflow jobs to prevent status check conflicts
JaegerCaiser Nov 7, 2025
e94eb77
Merge branch 'develop' of github.com:JaegerCaiser/mrdeveloper into de…
JaegerCaiser Nov 7, 2025
929d44a
refactor: implement conditional deploy logic in reusable workflows
JaegerCaiser Nov 7, 2025
d82870a
docs(blog): complete CI/CD saga post with conditional deploy architec…
JaegerCaiser Nov 7, 2025
549d92b
refactor: implement conditional deploy logic in reusable workflows
JaegerCaiser Nov 7, 2025
b983a4b
fix: correct preview URL link in PR comment
JaegerCaiser Nov 7, 2025
1933a06
Merge pull request #109 from JaegerCaiser/docs/blog-post-ci-cd-saga
JaegerCaiser Nov 7, 2025
828b43c
Merge pull request #111 from JaegerCaiser/docs/add-verify-then-act-pr…
JaegerCaiser Nov 7, 2025
507ab97
Merge branch 'develop' of github.com:JaegerCaiser/mrdeveloper into de…
JaegerCaiser Nov 7, 2025
0bd646d
Revert "Merge pull request #109 from JaegerCaiser/docs/blog-post-ci-c…
JaegerCaiser Nov 7, 2025
0d679a0
Merge pull request #129 from JaegerCaiser/revert/blog-posts-merge
JaegerCaiser Nov 7, 2025
b9b31e4
chore(release): 1.3.1-beta.1
github-actions[bot] Nov 7, 2025
90cf1a3
fix: add missing name field to validate-release-branch job
JaegerCaiser Nov 7, 2025
5a63117
fix: restore proper preview URL link format in PR comment
JaegerCaiser Nov 7, 2025
49e1ea4
refactor: standardize CI job names across workflows
JaegerCaiser Nov 7, 2025
4b6cbb7
refactor: remove push trigger from preview workflow
JaegerCaiser Nov 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ Provide project context and coding guidelines that AI should follow when generat

# 🤖 GitHub Copilot - Guia de Interação

## ⭐ Princípio Fundamental: Verificar, Depois Agir

**NUNCA confie na memória ou no contexto da conversa. SEMPRE verifique o estado atual do repositório antes de executar qualquer ação.**

- **Antes de Commitar:** Use `git status --porcelain` para confirmar os arquivos a serem commitados.
- **Antes de Fazer Push:** Use `git log --left-right` para comparar a branch local com a remota se houver risco de divergência.
- **Antes de Criar um PR de Release:** Use `git log main..HEAD` para gerar a lista de mudanças a partir da fonte da verdade (o Git), não da memória.
- **Antes de Editar um Arquivo:** Releia o arquivo se houver qualquer dúvida sobre seu estado atual.

Este princípio é a base para evitar retrabalho e garantir que todas as ações sejam deliberadas e baseadas em fatos.

## 📋 Sobre Esta Documentação

Este arquivo serve como guia de referência para futuras interações com o GitHub Copilot no desenvolvimento deste projeto.
Expand Down Expand Up @@ -210,7 +221,7 @@ git push -u origin feature/nome-da-feature

### Visão Geral

**Portfolio React SPA** - Site de portfólio moderno com animações, construído com React 18 + TypeScript + Vite.
**Portfolio React SPA** - Site de portfólio moderno com animações, construído com React 19 + TypeScript + Vite.

**Arquitetura Principal:**

Expand Down Expand Up @@ -354,6 +365,23 @@ pnpm lint:fix # Correção automática
- `reusable-release.yml`: Semantic release automation
- Cache de build artifacts (`.vite`, `node_modules/.cache`, `.eslintcache`)

**Debugging de Workflows do GitHub Actions:**

- **Tutorial completo:** Consulte `tutorial-github-actions-schema.md` para guia detalhado
- **Passo 1:** Execute `pnpm lint:yaml` para verificar sintaxe YAML
- **Passo 2:** Execute `pnpm lint` para verificar código relacionado
- **Passo 3:** Valide YAML com Python se necessário
- **Passo 4:** Analise erros específicos do linter (ex: condições `if`)
- **Regra:** YAML válido ≠ Workflow válido - sempre teste todas as camadas

**Correção de Erros de Lint em Workflows:**

- **Sintaxe YAML:** Use `pnpm lint:yaml` para validar arquivos `.github/workflows/*.yml`
- **Condições `if`:** Não use aspas em expressões GitHub Actions
- ❌ Errado: `if: "always() && !contains(...)"`
- ✅ Correto: `if: always() && !contains(...)`
- **Validação:** YAML válido não significa workflow válido - teste sempre

### Workflow Preview - Otimizações Recentes

**Implementado em novembro de 2025 - Resolução de duplicação e status checks quebrados:**
Expand Down
117 changes: 0 additions & 117 deletions .github/workflows/create-beta-tag.yml

This file was deleted.

9 changes: 6 additions & 3 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ on:

jobs:
test-and-lint:
name: Test & Lint
name: Develop - Test & Lint
uses: ./.github/workflows/reusable-test-and-lint.yml
with:
node-version: "22.x"

deploy-develop:
name: Deploy to Vercel Preview
name: Develop - Deploy to Vercel
needs: test-and-lint
# ✅ CORREÇÃO: Aplicando o tutorial
# 'if:' sem aspas externas
if: needs.test-and-lint.outputs.code-changed == 'true'
uses: ./.github/workflows/reusable-deploy-vercel.yml
with:
environment: Development
Expand All @@ -31,4 +34,4 @@ jobs:
prebuilt: true
secrets:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
57 changes: 31 additions & 26 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,75 @@
name: Preview Environment

# Workflow para deploy do ambiente de preview/staging
# Executado em Pull Requests para validar mudanças com testes, lint e um deploy de preview.
# Executado em:
# - Pull Requests (para preview de mudanças)
# - Push em branches release/* (para testes de release)
# Realiza testes, linting, build, deploy para Vercel (ambiente preview)
# e atualização automática de comentários nos PRs

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

# ✅ MÁGICA 1: Adicionado 'concurrency' para evitar disparos duplos
# (push + synchronize) no mesmo commit.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.sha || github.sha }}
cancel-in-progress: true

on:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
test-and-lint:
name: Test & Lint
name: CI - Test & Lint
# Este job SEMPRE roda (para satisfazer o check obrigatório)
# O 'dummy pass' acontece DENTRO do 'reusable-lint'
uses: ./.github/workflows/reusable-test-and-lint.yml
with:
node-version: "22.x"

always-run-check:
name: Basic Validation
runs-on: ubuntu-latest
steps:
- name: Always pass for required checks
run: echo "✅ PR validation completed"

deploy-preview:
name: Deploy to Vercel Preview
name: CI - Deploy to Vercel
needs: test-and-lint
if: ${{ needs.test-and-lint.outputs.code-changed == 'true' }}
# ❌ REMOVIDO: O 'if: needs.test-and-lint.outputs.code-changed == 'true''
# Este job TEM que rodar sempre para o status check
uses: ./.github/workflows/reusable-deploy-vercel.yml
with:
environment: Preview-${{ github.event.pull_request.number }}
environment: Preview
vercel-environment: preview
ref: ${{ github.event.pull_request.head.sha }}
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
prebuilt: true
prod: false
secrets:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}

validate-branch-for-main:
name: Validate Branch for Main
if: github.base_ref == 'main'
validate-release-branch:
name: Validate Release Branch for Main
# ✅ SEGUINDO O TUTORIAL: 'if:' sem aspas
if: github.event_name == 'pull_request' && github.base_ref == 'main'
runs-on: ubuntu-latest
steps:
- name: Check source branch name
run: |
SOURCE_BRANCH="${{ github.head_ref }}"
echo "Source branch: $SOURCE_BRANCH"
if [[ "$SOURCE_BRANCH" == release/* ]] || [[ "$SOURCE_BRANCH" == hotfix/* ]]; then
echo "Source branch '$SOURCE_BRANCH' is valid for merging into 'main'."
else
echo "::error::Pull Request from branch '$SOURCE_BRANCH' cannot be merged into 'main'. Only branches starting with 'release/' or 'hotfix/' are allowed."
if [[ "$SOURCE_BRANCH" != release/* ]]; then
echo "::error::Pull Request from branch '$SOURCE_BRANCH' cannot be merged into 'main'. Only branches starting with 'release/' are allowed."
exit 1
else
echo "Source branch '$SOURCE_BRANCH' is a valid release branch."
fi

update-pr-comment:
# ✅ SEGUINDO O TUTORIAL: 'if:' sem aspas
if: github.event_name == 'pull_request'
name: Update PR Comment
# Este 'needs' garante que ele espere o deploy terminar (ou ser pulado)
needs: deploy-preview
if: ${{ needs.deploy-preview.result == 'success' }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
Expand Down Expand Up @@ -93,4 +98,4 @@ jobs:

---
*Commit: `${{ github.event.pull_request.head.sha }}`*
edit-mode: replace
edit-mode: replace
25 changes: 18 additions & 7 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,24 @@ on:

jobs:
test-and-lint:
name: Test & Lint
if: ${{ !contains(github.event.head_commit.message, 'chore(release)') }}
name: CI - Test & Lint
# Este job SEMPRE roda para satisfazer o Required Check
# O filtro de paths está DENTRO do reusable-test-and-lint
uses: ./.github/workflows/reusable-test-and-lint.yml
with:
node-version: "22.x"

deploy-production:
name: Deploy to Vercel Production
name: CI - Deploy to Vercel
needs: test-and-lint
# ✅ CORREÇÃO: Aplicando o tutorial
# 'if:' sem aspas externas
# Pula o deploy se 'code-changed' for falso
if: needs.test-and-lint.outputs.code-changed == 'true'
uses: ./.github/workflows/reusable-deploy-vercel.yml
with:
environment: Production
vercel-environment: production
vercel-environment: production #
ref: ${{ github.sha }}
prebuilt: true
prod: true
Expand All @@ -38,8 +43,14 @@ jobs:

run-semantic-release:
name: Run Semantic Release
needs: deploy-production
if: ${{ !contains(github.event.head_commit.message, 'chore(release)') }}
needs: [test-and-lint, deploy-production] # Depende dos dois

# ✅ CORREÇÃO: Aplicando o tutorial
# 'if:' sem aspas externas
# 'always()' garante que ele rode mesmo se 'deploy-production' for 'skipped'
# 'not(contains...)' é a trava anti-loop (substituindo o '!')
if: always() && !contains(github.event.head_commit.message, 'chore(release)')

runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -50,7 +61,7 @@ jobs:
uses: actions/checkout@v5
with:
fetch-depth: 0
persist-credentials: false
persist-credentials: false #

- name: Setup pnpm
uses: pnpm/action-setup@v4
Expand Down
Loading