Skip to content

Add PR preview workflow (GitHub Actions + ArgoCD) - #2194

Open
satyamz wants to merge 1 commit into
mainfrom
add-pr-preview-workflow
Open

Add PR preview workflow (GitHub Actions + ArgoCD)#2194
satyamz wants to merge 1 commit into
mainfrom
add-pr-preview-workflow

Conversation

@satyamz

@satyamz satyamz commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Migrates this repo's per-PR preview environments from the Jenkins preview pipeline (stellar/pipelines) to GitHub Actions + ArgoCD.

How it works

  • On every PR event (opened / synchronize / reopened / closed) the workflow runs the sdf-pr-preview composite actions: gate (withdraws the preview label, checks org membership) -> build & push the preview image(s) to dev ECR -> publish (verifies the images exist, restores the label, comments the preview URL).
  • ArgoCD ApplicationSet(s) preview-laboratory in stellar/kube watch PRs carrying the preview label and deploy one charts/pr-previews release per PR. Closing the PR tears the preview down.
  • Images are tagged pr-<number>-<head-sha>: dev/laboratory

Preview URL(s)

  • https://laboratory-pr-<number>.previews.kube001.services.stellar-ops.com

Security

The workflow runs on pull_request_target (required for fork PRs to get OIDC + label/comment permissions). Per the sdf-pr-preview caller contract: the gate runs before any PR code is checked out, and every later step is guarded by steps.gate.outputs.member == 'true', so non-member PRs never build.

Before merging

  • preview label exists in this repo
  • PREVIEW_BOT_APP_ID repo variable and PREVIEW_BOT_PRIVATE_KEY secret are set
  • This repo can assume the dev ECR push role via OIDC (sdf-ecr-login)
  • The matching ApplicationSet + values in stellar/kube are merged

🤖 Generated with Claude Code

Replaces the Jenkins preview pipeline (stellar/pipelines) with the
gate -> build -> publish flow from stellar/actions/sdf-pr-preview.
ArgoCD ApplicationSets in stellar/kube deploy a preview per PR
carrying the 'preview' label and tear it down on close.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings August 28, 2026 15:10
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Aug 28, 2026
Comment on lines +43 to +49
- uses: actions/checkout@v6
if: steps.gate.outputs.member == 'true'
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false

- id: ecr-login

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds automated per-PR preview deployments using GitHub Actions, ECR, and ArgoCD.

Changes:

  • Gates preview builds to trusted organization members.
  • Builds and publishes PR-specific Docker images.
  • Manages preview labels and URL comments.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +43 to +47
- uses: actions/checkout@v6
if: steps.gate.outputs.member == 'true'
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
@stellar-jenkins-ci

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog (Not Ready)

Development

Successfully merging this pull request may close these issues.

3 participants