|
| 1 | +# Staging Environment Setup for GitHub Pages |
| 2 | + |
| 3 | +This guide explains how to set up a staging environment for the documentation that deploys to `procore-staging.github.io/documentation`. |
| 4 | + |
| 5 | +## Feature Branch Staging Workflow |
| 6 | + |
| 7 | +Use the same repository with `staging-*` branch pattern for per-feature staging deployments: |
| 8 | + |
| 9 | +1. **Work on your feature branch** (e.g., `my-feature-change-1`) |
| 10 | +2. **Create a staging branch** with `staging-` prefix (e.g., `staging-my-feature-change-1`) |
| 11 | +3. **Push the staging branch** - the `.github/workflows/staging.yml` workflow will automatically: |
| 12 | + - Detect branches matching `staging-*` pattern |
| 13 | + - Build with staging configuration (`_config_staging.yml`) |
| 14 | + - Deploy to `procore-staging.github.io/documentation/` |
| 15 | + |
| 16 | +**How it works:** |
| 17 | +- Any branch starting with `staging-` triggers the staging deployment workflow |
| 18 | +- Each feature can have its own staging branch: `staging-feature-name` |
| 19 | +- The workflow uses the staging config which sets `url: "https://procore-staging.github.io"` |
| 20 | + |
| 21 | +**Example workflow:** |
| 22 | +```bash |
| 23 | +# 1. Work on your feature |
| 24 | +git checkout -b my-feature-change-1 |
| 25 | +# ... make changes ... |
| 26 | + |
| 27 | +# 2. When ready for staging, create staging branch |
| 28 | +git checkout -b staging-my-feature-change-1 |
| 29 | + |
| 30 | +# 3. Push to trigger staging deployment |
| 31 | +git push origin staging-my-feature-change-1 |
| 32 | +# → GitHub Actions automatically builds and deploys to procore-staging.github.io |
| 33 | +``` |
| 34 | + |
| 35 | +## Main Branch Deployment to Staging |
| 36 | + |
| 37 | +When the `main` branch is merged or pushed, it will also automatically deploy to `procore-staging.github.io/documentation/`: |
| 38 | + |
| 39 | +- **Purpose**: Keeps the staging environment in sync with the latest production-ready code from `main` |
| 40 | +- **Trigger**: Any push or merge to the `main` branch |
| 41 | +- **Deployment**: Same staging subdomain (`procore-staging.github.io`) as feature branch deployments |
| 42 | +- **Result**: Staging always reflects the current state of `main` branch |
| 43 | + |
| 44 | +**Note**: This means `main` branch content will be available at `procore-staging.github.io/documentation/`, allowing you to test the latest production code in the staging environment before it goes to production. |
| 45 | + |
| 46 | + |
0 commit comments