gitops-workflow

star 2

complete lifecycle for making changes, from PR to ArgoCD sync

ryanbeales By ryanbeales schedule Updated 2/18/2026

name: gitops-workflow description: complete lifecycle for making changes, from PR to ArgoCD sync

GitOps Workflow

This skill covers the entire lifecycle of a change in this repository, from creating a branch to verifying the deployment in ArgoCD.

1. Development and PR Creation

[!CAUTION] NEVER push directly to main. The main branch is protected and pushes will be rejected. You MUST always create a feature branch BEFORE committing. If you have already committed to main by mistake, see the recovery steps below.

  1. Prepare Main: Ensure you are on the latest main.
    git checkout main
    git pull origin main
    
  2. Feature Branch: Create a descriptive branch before making any commits.
    git checkout -b <branch-name>
    
  3. Commit & Push:
    git add .
    git commit -m "<commit-message>"
    git push -u origin <branch-name>
    
  4. Create PR & Auto-Merge:
    gh pr create --fill
    gh pr merge --auto --merge
    

Recovery: Accidental Commit to Main

If you've already committed to main, move the commit(s) to a feature branch:

# Create a branch at the current commit
git branch <branch-name>
# Reset main back (soft keeps changes staged)
git reset HEAD~1 --soft
# Discard the staged changes on main (they're safe on the branch)
git checkout -- .
# Switch to the feature branch and push
git checkout <branch-name>
git push -u origin <branch-name>

2. CI Verification and Merge

  1. Watch Checks: Pause until CI completes.
    gh pr checks --watch
    
    • If checks fail: Investigate logs immediately:
      gh run view --log-failed
      
  2. Verify Merge: Confirm the PR has reached the MERGED state.
    gh pr view --json state -q .state
    

3. Post-Merge Sync and Deployment

  1. Update Local Main:
    git checkout main
    git pull origin main
    
  2. Verify ArgoCD Sync: Confirm the change is applied to the cluster.
    # App name is usually the directory name or found in argocd.yaml
    kubectl get app -n argocd <app-name>
    
  3. Verify Health: Ensure the application transitions to Healthy and Synced.

Standards

  • Auto-Sync: Most applications have prune: true and selfHeal: true.
  • Diagnostics: If the app is not healthy, use the k8s-diagnostic skill to investigate.
Install via CLI
npx skills add https://github.com/ryanbeales/personal-k8s-config --skill gitops-workflow
Repository Details
star Stars 2
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator