Merged in chore/release-pipeline (pull request #3352)

Add scripts for handling deployments

Approved-by: Linus Flood
This commit is contained in:
Joakim Jäderberg
2025-12-16 11:42:51 +00:00
parent bf7a2ac2fe
commit f27ba7ccb6
15 changed files with 242 additions and 63 deletions

29
docs/deploy.md Normal file
View File

@@ -0,0 +1,29 @@
## Deployment Script
This script automates the deployment process for the application by force-pushing the current branch to specific environment branches.
Deploying to production must be done via a release-branch
### Usage
Be situated on the branch you want to deploy and then run the script using `yarn deploy:<environment>`
```bash
yarn deploy:stage
```
or if you want to explicitly call it by using `yarn dlx tsx scripts/deploy/deploy.ts` (or `bun`/`npx tsx`)
### Environments
| Environment | Target Branch | Description |
| :---------- | :------------ | :----------------------------------------- |
| `test` | `test` | Deploys to the test environment. |
| `stage` | `stage` | Deploys to the staging environment. |
| `preprod` | `prod` | Deploys to the pre-production environment. |
| `prod` | `release` | Deploys to the production environment. |
### Features
- **Branch Validation**: Checks if the target environment is valid.
- **Tagging**: If deploying from a release branch (e.g., `release-v1.2.3`), it automatically creates and pushes a git tag (e.g., `v1.2.3`) if it doesn't exist.
- **Safety Check**: Prompts for confirmation before deploying.