Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .controlplane/controlplane.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ apps:
allow_app_override_by_env: false

# Use a different organization for production.
cpln_org: shakacode-open-source-examples
cpln_org: shakacode-open-source-examples-production

upstream: react-webpack-rails-tutorial-staging

Expand Down
26 changes: 8 additions & 18 deletions .github/workflows/promote-staging-to-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,21 @@ jobs:
runs-on: ubuntu-latest
if: github.event.inputs.confirm_promotion == 'promote'

env:
APP_NAME: react-webpack-rails-tutorial
CPLN_ORG: ${{ secrets.CPLN_ORG }}
UPSTREAM_TOKEN: ${{ secrets.STAGING_TOKEN }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Environment
uses: ./.github/actions/setup-environment
env:
CPLN_TOKEN: ${{ secrets.CPLN_TOKEN }}
with:
token: ${{ secrets.CPLN_TOKEN_PRODUCTION }}
org: ${{ vars.CPLN_ORG_PRODUCTION }}

- name: Promote Staging to Production
id: promote
run: |
echo "🚀 Starting promotion from staging to production..."

if ! cpflow promote-app-from-upstream -a "${APP_NAME}" -t "${UPSTREAM_TOKEN}" --org "${CPLN_ORG}"; then
echo "❌ Failed to promote staging to production"
exit 1
fi

echo "✅ Successfully promoted staging to production"
- name: Copy Image from Staging
run: cpflow copy-image-from-upstream -a ${{ vars.PRODUCTION_APP_NAME }} -t ${{ secrets.CPLN_TOKEN_STAGING }}

- name: Deploy Image to Production
run: cpflow deploy-image -a ${{ vars.PRODUCTION_APP_NAME }} --run-release-phase --org ${{ vars.CPLN_ORG_PRODUCTION }}

- name: Create GitHub Release
if: success()
Expand Down
Loading