From 29f354b835ae5626110305a3df6222d4bea6e894 Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 30 Jun 2025 20:45:47 -0700 Subject: [PATCH] feat: update workflows for develop/staging/master branch structure --- .github/workflows/deploy-prod.yml | 2 ++ .github/workflows/deploy-staging.yml | 2 +- CONTRIBUTING.md | 28 +++++++++++++++------------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index e0d88ef..efc30ee 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -1,6 +1,8 @@ name: Deploy to Production on: + push: + branches: [ master ] release: types: [published] workflow_dispatch: diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index d38969e..8a839f0 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -2,7 +2,7 @@ name: Deploy to Staging on: push: - branches: [ main ] + branches: [ staging ] workflow_dispatch: env: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ab4c140..5da0d1c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,15 +29,17 @@ Thank you for considering contributing to this project! This guide will help you We use a GitFlow-inspired workflow: -- **`main`** - Production-ready code, deployed to staging automatically +- **`master`** - Production-ready code, deployed to production automatically +- **`staging`** - Staging branch, deployed to staging environment automatically - **`develop`** - Development branch, deployed to dev environment automatically - **`feature/*`** - Feature branches, create PR to develop -- **`hotfix/*`** - Hotfix branches, create PR to main +- **`hotfix/*`** - Hotfix branches, create PR to master - **`release/*`** - Release branches for production deployment ### Branch Protection Rules -- **`main`**: Requires PR review, all checks must pass +- **`master`**: Requires PR review, all checks must pass +- **`staging`**: Requires PR review, all checks must pass - **`develop`**: Requires PR review, all checks must pass ## Deployment Environments @@ -45,8 +47,8 @@ We use a GitFlow-inspired workflow: | Environment | Branch | Domain | Auto-Deploy | |-------------|--------|---------|------------| | Development | `develop` | `2048-dev.wa.darknex.us` | ✅ | -| Staging | `main` | `2048-staging.wa.darknex.us` | ✅ | -| Production | `tags` | `2048.wa.darknex.us` | Manual | +| Staging | `staging` | `2048-staging.wa.darknex.us` | ✅ | +| Production | `master` | `2048.wa.darknex.us` | ✅ | ## Making Changes @@ -72,14 +74,14 @@ We use a GitFlow-inspired workflow: ### For Bug Fixes -1. Create a hotfix branch from `main`: +1. Create a hotfix branch from `master`: ```bash - git checkout main - git pull origin main + git checkout master + git pull origin master git checkout -b hotfix/fix-description ``` -2. Make your changes and create PR to `main` +2. Make your changes and create PR to `master` ## Commit Convention @@ -133,16 +135,16 @@ curl -f https://2048-dev.wa.darknex.us/ ## Release Process -1. Create a release branch from `main`: +1. Create a release branch from `master`: ```bash - git checkout main - git pull origin main + git checkout master + git pull origin master git checkout -b release/v1.1.0 ``` 2. Update version in `package.json` -3. Create PR to `main` +3. Create PR to `master` 4. After merge, create a GitHub release with tag