-
Couldn't load subscription status.
- Fork 380
Github Actions Promote #625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
eeabd9c
652df55
1ef522b
269c684
b1d0b14
a2f8923
1ca2e06
3ddf8a5
6131ce6
544cce4
fa96ca0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,16 +18,16 @@ jobs: | |
| help: | ||
| if: ${{ (github.event.issue.pull_request && github.event.comment.body == '/help') || github.event_name == 'workflow_dispatch' }} | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Show Available Commands | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const sections = { | ||
| commands: { | ||
| deploy: { | ||
| title: '## `/deploy`', | ||
| "deploy-review-app": { | ||
| title: '## `/deploy-review-app`', | ||
| purpose: '**Purpose:** Deploy a review app for your pull request', | ||
| details: [ | ||
| '**What it does:**', | ||
|
|
@@ -42,8 +42,8 @@ jobs: | |
| ' - Example: `/deploy timeout=1800`' | ||
| ] | ||
| }, | ||
| destroy: { | ||
| title: '## `/destroy`', | ||
| "delete-review-app: { | ||
| title: '## `/delete-review-app`', | ||
| purpose: '**Purpose:** Remove the review app for your pull request', | ||
| details: [ | ||
| '**What it does:**', | ||
|
|
@@ -96,17 +96,18 @@ jobs: | |
| details: [ | ||
| 'Review apps are automatically destroyed when:', | ||
| '1. The pull request is closed', | ||
| '2. The `/destroy` command is used', | ||
| '2. The `/delete-review-app` command is used', | ||
| '3. A new deployment is requested (old one is cleaned up first)' | ||
| ] | ||
| }, | ||
| help: { | ||
| title: '## Need Help?', | ||
| details: [ | ||
| 'For additional assistance:', | ||
| '1. Check the [Control Plane documentation](https://docs.controlplane.com/)', | ||
| 'For additional assistance, ', | ||
| '1. Check the [Control Plane Flow documentation](https://www.shakacode.com/control-plane-flow/docs/)', | ||
| '2. Contact the infrastructure team', | ||
| '3. Open an issue in this repository' | ||
| '3. [Open an issue in this repository](https://github.com/shakacode/control-plane-flow/issues/new)', | ||
| '4. [Contact ShakaCode support](mailto:[email protected])' | ||
| ] | ||
| } | ||
| }; | ||
|
|
@@ -148,4 +149,3 @@ jobs: | |
| issue_number: prNumber, | ||
| body: helpText | ||
| }); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,28 +9,35 @@ on: | |
| type: string | ||
|
|
||
| jobs: | ||
| debug: | ||
| uses: ./.github/workflows/debug-workflow.yml | ||
| with: | ||
| debug_enabled: false | ||
|
|
||
| promote-to-production: | ||
| 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 }} | ||
| APP_NAME: ${{ vars.PRODUCTION_APP_NAME }} | ||
| CPLN_ORG: ${{ vars.CPLN_ORG_PRODUCTION }} | ||
| CPLN_TOKEN: ${{ secrets.CPLN_TOKEN_PRODUCTION }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolve CPLN_TOKEN inconsistency. There are two different CPLN_TOKEN references:
This could lead to confusion or errors. Update line 29 to use the production token: uses: ./.github/actions/setup-environment
env:
- CPLN_TOKEN: ${{ secrets.CPLN_TOKEN }}
+ CPLN_TOKEN: ${{ secrets.CPLN_TOKEN_PRODUCTION }}Also applies to: 29-29 |
||
| UPSTREAM_TOKEN: ${{ secrets.CPLN_TOKEN_STAGING }} | ||
|
|
||
| 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..." | ||
| echo "🚀 Starting promotion from staging to production... for app ${APP_NAME}" | ||
|
|
||
| if ! cpflow promote-app-from-upstream -a "${APP_NAME}" -t "${UPSTREAM_TOKEN}" --org "${CPLN_ORG}"; then | ||
| echo "❌ Failed to promote staging to production" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix YAML syntax error in command definition.
There's a missing closing quote in the command key name.
📝 Committable suggestion