Skip to content
Discussion options

You must be logged in to vote

What's a common pattern for deploying to staging first, running integration tests, and then promoting to production only if those tests pass — without re-building the code at each stage?

This is a build-once, deploy-many pattern, and it's a best practice for CI/CD pipelines. The key insight is to pass the build artifact (or container image) through the stages without rebuilding.

Here's the common pattern using GitHub Actions:

name: Build and promote across environments

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
      - run: npm ci
      - run: npm run build
      - uses: actions/upload-artifact@v4
        with

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sudoUgando
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants