|
| 1 | +# Development Workflow |
| 2 | + |
| 3 | +This document outlines the proper development workflow for the IFLA Standards project. |
| 4 | + |
| 5 | +## Repository Setup |
| 6 | + |
| 7 | +- **Main Repository**: `iflastandards/standards-dev` (upstream) |
| 8 | +- **Development Fork**: `jonphipps/standards-dev` (fork) |
| 9 | +- **Local Remotes**: |
| 10 | + - `origin`: `[email protected]:iflastandards/standards-dev.git` |
| 11 | + - `fork`: `[email protected]:jonphipps/standards-dev.git` |
| 12 | + |
| 13 | +## Environment Deployment |
| 14 | + |
| 15 | +| Environment | Branch | Repository | Deployment URL | Triggers | |
| 16 | +|-------------|--------|------------|----------------|----------| |
| 17 | +| **Development** | `dev` | `jonphipps/standards-dev` | `https://jonphipps.github.io/standards-dev/` | Push to `dev` branch | |
| 18 | +| **Preview** | `main` | `iflastandards/standards-dev` | `https://iflastandards.github.io/standards-dev/` | Push/PR to `main` branch | |
| 19 | +| **Production** | `main` | `iflastandards/standards-dev` | `https://iflastandards.info/` | Automatic from main | |
| 20 | + |
| 21 | +## Development Workflow |
| 22 | + |
| 23 | +### 1. Development & Testing |
| 24 | +```bash |
| 25 | +# Work on dev branch (your personal testing environment) |
| 26 | +git checkout dev |
| 27 | +git pull fork dev |
| 28 | + |
| 29 | +# Make changes, commit as usual |
| 30 | +git add . |
| 31 | +git commit -m "your changes" |
| 32 | + |
| 33 | +# Push to your fork - triggers deploy-dev.yml |
| 34 | +git push fork dev |
| 35 | + |
| 36 | +# Test changes at: https://jonphipps.github.io/standards-dev/ |
| 37 | +``` |
| 38 | + |
| 39 | +### 2. Move to Preview (Create Pull Request) |
| 40 | +Once changes are tested and ready: |
| 41 | + |
| 42 | +```bash |
| 43 | +# Create PR from your fork's dev branch to upstream main |
| 44 | +gh pr create --repo iflastandards/standards-dev --base main --head jonphipps:dev --title "Your PR Title" --body "Description of changes" |
| 45 | +``` |
| 46 | + |
| 47 | +**OR** use GitHub web interface: |
| 48 | +- Go to `https://github.com/iflastandards/standards-dev` |
| 49 | +- Click "New pull request" |
| 50 | +- Select: `iflastandards/standards-dev:main` ← `jonphipps/standards-dev:dev` |
| 51 | + |
| 52 | +### 3. Preview & Production Deployment |
| 53 | +- **PR merge to main** → Triggers `ci-preview.yml` → Deploys to preview site |
| 54 | +- **Main branch updates** → Triggers `deploy-all.yml` → Deploys to production |
| 55 | + |
| 56 | +## Workflow Summary |
| 57 | + |
| 58 | +1. **Development**: `jonphipps/standards-dev:dev` → Test on personal GitHub Pages |
| 59 | +2. **Preview**: PR to `iflastandards/standards-dev:main` → Preview on official staging |
| 60 | +3. **Production**: Automatic deployment from main branch → Live site |
| 61 | + |
| 62 | +## GitHub Actions |
| 63 | + |
| 64 | +- **`deploy-dev.yml`**: Builds and deploys dev branch to personal GitHub Pages |
| 65 | +- **`ci-preview.yml`**: Builds and deploys main branch to preview site (triggers on main branch only) |
| 66 | +- **`deploy-all.yml`**: Handles production deployment |
| 67 | + |
| 68 | +## Environment Configuration |
| 69 | + |
| 70 | +Environment settings are defined in `packages/theme/src/config/siteConfigCore.ts`: |
| 71 | + |
| 72 | +- `DocsEnv.Dev`: Personal development environment (`https://jonphipps.github.io`) |
| 73 | +- `DocsEnv.Preview`: Official preview environment (`https://iflastandards.github.io`) |
| 74 | +- `DocsEnv.Production`: Production environment (`https://iflastandards.info`) |
| 75 | + |
| 76 | +## Notes |
| 77 | + |
| 78 | +- Always test changes in the dev environment before creating PRs |
| 79 | +- The `ci-preview.yml` workflow only triggers on pushes/PRs to the main branch |
| 80 | +- SSH authentication is recommended for pushing workflow files |
| 81 | +- Ensure GitHub Pages is enabled on your fork with `gh-pages` branch as source |
0 commit comments