|
| 1 | +# IFRC GO - Deployment Workflow |
| 2 | + |
| 3 | +This document covers how code moves from the project branch through alpha, staging, and production. For the development workflow (branching, PRs, rebase), see [Development Workflow](./development-workflow.md). |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## Environment Reference |
| 8 | + |
| 9 | +| Environment | URL | Branch / image deployed | |
| 10 | +|---|---|---| |
| 11 | +| **Alpha** | internal | `project/<n>` branch | |
| 12 | +| **Staging** | `go-stage.ifrc.org` | `develop` (beta release tag) | |
| 13 | +| **Production** | `go.ifrc.org` | Tagged release (e.g. `go-web-app@7.x.x`) | |
| 14 | + |
| 15 | +Admin staging is at `goadmin-stage.ifrc.org`. Ensure it is in sync before requesting UAT. |
| 16 | + |
| 17 | +--- |
| 18 | + |
| 19 | +## Step-by-Step Workflow |
| 20 | + |
| 21 | +### 1. Deploy the project branch to the alpha instance |
| 22 | + |
| 23 | +Once a meaningful set of features is merged to the project branch, trigger a deployment to the alpha environment. The CI/CD pipeline (`/.github/workflows/`) handles this on push to the project branch. Verify the Docker image is built and deployed via the `ifrcgo-web-app-nginx-serve-alpha` container. |
| 24 | + |
| 25 | +The alpha instance runs the **project branch** directly. It is a pre-QA environment and may be unstable. |
| 26 | + |
| 27 | +--- |
| 28 | + |
| 29 | +### 2. Run QA on the alpha instance |
| 30 | + |
| 31 | +The QA team runs the full test suite and exploratory testing against the alpha instance. File issues directly against the project branch. Developers fix, re-deploy, and iterate until QA passes. |
| 32 | + |
| 33 | +--- |
| 34 | + |
| 35 | +### 3. Create a beta release and deploy to staging |
| 36 | + |
| 37 | +After the project branch is [merged to `develop`](./development-workflow.md#5-merge-the-project-branch-to-develop), the new beta version is created using the changeset along with the necessary tags. Review and push it to bump package versions and update the changelog file, then trigger the beta release pipeline: |
| 38 | + |
| 39 | +Enter beta pre-release mode in changeset (if not already) |
| 40 | +```bash |
| 41 | +pnpm changeset pre enter beta |
| 42 | +``` |
| 43 | + |
| 44 | +And then proceed updating changelog and creating tags |
| 45 | + |
| 46 | +```bash |
| 47 | +pnpm changeset version |
| 48 | +git diff |
| 49 | +git add -A |
| 50 | +git commit -m "v7.27.0-beta.2" |
| 51 | +pnpm changeset tag |
| 52 | +git push --follow-tags |
| 53 | +``` |
| 54 | + |
| 55 | +> [!NOTE] |
| 56 | +> - Azure deployment needs to be triggered manually for the frontend. |
| 57 | +> - New release needs to be created manually in GitHub with the pushed tags. For beta releases, it should be marked as pre-release. |
| 58 | +> - Backend has a separate deployment process. |
| 59 | +
|
| 60 | +--- |
| 61 | + |
| 62 | +### 4. Run sanity test and request IFRC UAT |
| 63 | + |
| 64 | +With the beta deployed to staging: |
| 65 | + |
| 66 | +1. Run a smoke test against `go-stage.ifrc.org` and `goadmin-stage.ifrc.org` to confirm |
| 67 | + the deployment is healthy and the admin backend is in sync. |
| 68 | +2. Share the staging URL with the IFRC team and request |
| 69 | + **User Acceptance Testing (UAT)**. |
| 70 | +3. Collect feedback. If blockers are found, fix them on `develop`, cut a new beta |
| 71 | + (e.g. `go-web-app@7.24.0-beta.1`), and redeploy to staging. |
| 72 | + |
| 73 | +--- |
| 74 | + |
| 75 | +### 5. Create a production release and deploy to production |
| 76 | + |
| 77 | +Once UAT is approved, create new prod release. |
| 78 | + |
| 79 | +Exit beta pre-release mode in changeset |
| 80 | + |
| 81 | +```bash |
| 82 | +pnpm changeset pre exit |
| 83 | +``` |
| 84 | + |
| 85 | +Now proceed with updating changelog and generating the appropriate tags |
| 86 | + |
| 87 | +```bash |
| 88 | +pnpm changeset version |
| 89 | +git diff |
| 90 | +git add -A |
| 91 | +git commit -m "v7.27.0" |
| 92 | +pnpm changeset tag |
| 93 | +git push --follow-tags |
| 94 | +``` |
| 95 | + |
| 96 | +Once these changes are pushed to `develop`, a fresh `release` branch from `develop` is created and force-pushed. The prod release is then done from the `release` branch through Azure pipeline. |
| 97 | + |
| 98 | +> [!NOTE] |
| 99 | +> - Azure deployment needs to be triggered manually for the frontend. |
| 100 | +> - New release needs to be created manually in GitHub with the pushed tags. For prod releases, it should be marked as latest release. |
| 101 | +> - Backend has a separate deployment process. |
| 102 | +
|
| 103 | +--- |
| 104 | + |
| 105 | +## Hotfixes |
| 106 | + |
| 107 | +Hotfixes that must reach production immediately bypass the project branch: branch off `release`, open the PR directly to `release`, and deploy from there. An equivalent PR must be included to `develop` branch as well to assure that the changes are reflected there too. |
0 commit comments