-
Notifications
You must be signed in to change notification settings - Fork 384
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
Github Actions Promote #625
Closed
Closed
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
eeabd9c
promote
justin808 652df55
fix help docs
justin808 1ef522b
fix invalid use of secret/vars
justin808 269c684
fix org
justin808 b1d0b14
fix validation
justin808 a2f8923
syntax errors
justin808 1ca2e06
fix comments
justin808 3ddf8a5
fix deploy
justin808 6131ce6
fix app name and messages
justin808 544cce4
WIP
justin808 fa96ca0
debug
justin808 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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