Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 9, 2025

This PR implements dynamic version switching by publishing comprehensive version info to S3 after each frontend deployment, enabling instant version switching without infrastructure changes.

Changes Made

GitHub Actions Workflow (publish.yml)

Added two new steps to the deployment workflow that run after successful S3 upload:

  1. Create version info: Generates a comprehensive config/version.json file with:
    • Current deployed version
    • Description and timestamp
    • Rollback version field
    • Deployment metadata (deployed by, environment)
  2. Upload version info: Uploads the file to s3://bucket/config/version.json at the S3 bucket root

The version file format is:

{
  "version": "0.4.0",
  "description": "Current frontend version configuration",
  "lastUpdated": "2024-01-01T00:00:00Z",
  "rollbackVersion": "0.3.0",
  "metadata": {
    "deployedBy": "github-actions",
    "environment": "production"
  }
}

Documentation (README.md)

Added comprehensive documentation covering:

  • How the version management system works with the new format
  • Step-by-step deployment instructions
  • Rollback procedures without redeployment
  • Benefits and future capabilities

Benefits

Immediate:

  • ✅ Instant version switching by updating a single JSON file
  • ✅ Simple rollback mechanism without redeploying infrastructure
  • ✅ Version info accessible to CloudFront for dynamic routing
  • ✅ Rich metadata for deployment tracking

Future enablement:

  • 🚀 A/B testing capabilities
  • 🚀 Canary deployments
  • 🚀 Advanced deployment strategies

Example Usage

Deploy new version:
Run the "Publish to s3" workflow with version v1.2.4 → automatically updates config/version.json

Rollback to previous version:
Manually update S3 file: change "version": "1.2.4" to "version": "1.2.3" → instant rollback

The implementation is minimal and surgical, adding only the necessary functionality without modifying existing deployment logic.

Fixes #99.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: saebyn <185030+saebyn@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Update deploy workflow to publish frontend version info to S3 Add dynamic version switching support to deployment workflow Aug 9, 2025
@Copilot Copilot AI requested a review from saebyn August 9, 2025 19:29
Copilot finished work on behalf of saebyn August 9, 2025 19:29
saebyn
saebyn previously requested changes Aug 9, 2025
Copy link
Owner

@saebyn saebyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the format expected for the config/version.json:

{
  "version": "0.4.0",
  "description": "Current frontend version configuration",
  "lastUpdated": "2024-01-01T00:00:00Z",
  "rollbackVersion": "0.3.0",
  "metadata": {
    "deployedBy": "system",
    "environment": "production"
  }
}

@saebyn
Copy link
Owner

saebyn commented Aug 9, 2025

@copilot can you update this PR to match?

- Changed version.json from simple {"currentVersion":"v1.2.3"} to comprehensive format
- Includes version, description, lastUpdated timestamp, rollbackVersion, and metadata
- Updated GitHub Actions workflow to generate new format with deployment info
- Updated README.md documentation to reflect new structure

Co-authored-by: saebyn <185030+saebyn@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 9, 2025

@copilot can you update this PR to match?

Updated the version configuration format to match the expected structure. The workflow now generates a comprehensive JSON file with version, description, timestamp, rollback version, and deployment metadata. Commit: 92517cf

@Copilot Copilot AI changed the title Add dynamic version switching support to deployment workflow Add comprehensive version configuration with metadata to deployment workflow Aug 9, 2025
@Copilot Copilot AI requested a review from saebyn August 9, 2025 21:32
Copilot finished work on behalf of saebyn August 9, 2025 21:32
@saebyn saebyn marked this pull request as ready for review August 9, 2025 21:47
@Copilot Copilot AI review requested due to automatic review settings August 9, 2025 21:47
@saebyn saebyn enabled auto-merge (rebase) August 9, 2025 21:47
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a dynamic version management system for frontend deployments by adding comprehensive version configuration metadata. The changes enable instant version switching and rollback capabilities without requiring infrastructure redeployment.

Key changes:

  • Added automated version configuration file generation to the deployment workflow
  • Created comprehensive documentation for the new version management system
  • Implemented S3-based version tracking with deployment metadata

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/publish.yml Added two new steps to generate and upload version configuration JSON with deployment metadata
README.md Added comprehensive documentation covering version management workflow, deployment procedures, and rollback instructions

@saebyn saebyn merged commit 5a6a6bd into main Aug 9, 2025
4 checks passed
@saebyn saebyn deleted the copilot/fix-99 branch August 9, 2025 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update deploy workflow to publish frontend version info to S3

2 participants