Skip to content

Commit fbfa9ee

Browse files
committed
Revert "More work on github actions (#621)"
This reverts commit 6add086.
1 parent eda7219 commit fbfa9ee

8 files changed

+100
-107
lines changed

.github/actions/help-command/action.yml

-93
This file was deleted.

.github/workflows/delete-review-app.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
fi
5959
6060
- name: Setup Environment
61-
uses: ./.github/actions/setup-environment
61+
uses: ./.github/actions/setup-environment@justin808-working-for-deploys
6262
with:
6363
org: ${{ env.CPLN_ORG }}
6464
token: ${{ env.CPLN_TOKEN }}
@@ -132,7 +132,7 @@ jobs:
132132
return { commentId: comment.data.id };
133133
134134
- name: Delete Review App
135-
uses: ./.github/actions/delete-control-plane-app
135+
uses: ./.github/actions/delete-control-plane-app@justin808-working-for-deploys
136136
with:
137137
app_name: ${{ env.APP_NAME }}
138138
org: ${{ env.CPLN_ORG }}

.github/workflows/deploy-to-control-plane-staging.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
fetch-depth: 0 # Fetch all history for proper SHA handling
2727
ref: master # Explicitly checkout master branch
2828

29-
- uses: ./.github/actions/deploy-to-control-plane
29+
- uses: ./.github/actions/deploy-to-control-plane@justin808-working-for-deploys
3030
with:
3131
app_name: ${{ vars.STAGING_APP_NAME }}
3232
org: ${{ vars.CPLN_ORG_STAGING }}

.github/workflows/deploy-to-control-plane.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || steps.getRef.outputs.PR_REF || github.ref }}
4141

4242
- name: Setup Environment
43-
uses: ./.github/actions/setup-environment
43+
uses: ./.github/actions/setup-environment@justin808-working-for-deploys
4444
with:
4545
token: ${{ env.CPLN_TOKEN }}
4646
org: ${{ env.CPLN_ORG }}
@@ -228,7 +228,7 @@ jobs:
228228
github.event.issue.pull_request &&
229229
github.event.comment.body == '/deploy-review-app') ||
230230
(steps.check-app.outputs.app_exists == 'true')
231-
uses: ./.github/actions/build-docker-image
231+
uses: ./.github/actions/build-docker-image@justin808-working-for-deploys
232232
with:
233233
app_name: ${{ env.APP_NAME }}
234234
org: ${{ env.CPLN_ORG }}
@@ -269,7 +269,7 @@ jobs:
269269
github.event.issue.pull_request &&
270270
github.event.comment.body == '/deploy-review-app') ||
271271
(steps.check-app.outputs.app_exists == 'true')
272-
uses: ./.github/actions/deploy-to-control-plane
272+
uses: ./.github/actions/deploy-to-control-plane@justin808-working-for-deploys
273273
with:
274274
app_name: ${{ env.APP_NAME }}
275275
org: ${{ env.CPLN_ORG }}

.github/workflows/help-command.yml

+90-5
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,95 @@ jobs:
2222
runs-on: ubuntu-latest
2323

2424
steps:
25-
- name: Checkout
26-
uses: actions/checkout
25+
- name: Identify Workflow Branch
26+
run: |
27+
echo "Workflow branch ref: ${{ github.ref }}"
2728
28-
- name: Show Help Information
29-
uses: ./.github/actions/help-command
29+
- name: Show Available Commands
30+
uses: actions/github-script@v7
3031
with:
31-
github-token: ${{ secrets.GITHUB_TOKEN }}
32+
script: |
33+
try {
34+
console.log('Creating detailed help message...');
35+
const helpMessage = [
36+
'# 📚 Detailed Review App Commands Guide',
37+
'',
38+
'This is a detailed guide to using review app commands. For a quick reference, see the message posted when your PR was created.',
39+
'',
40+
'## Available Commands',
41+
'',
42+
'### `/deploy-review-app`',
43+
'Deploys your PR branch to a review environment on Control Plane.',
44+
'- Creates a new review app if one doesn\'t exist',
45+
'- Updates the existing review app if it already exists',
46+
'- Provides a unique URL to preview your changes',
47+
'- Shows build and deployment progress in real-time',
48+
'',
49+
'**Required Environment Secrets:**',
50+
'- `CPLN_TOKEN_STAGING`: Control Plane authentication token',
51+
'- `CPLN_TOKEN_PRODUCTION`: Control Plane authentication token',
52+
'',
53+
'**Required GitHub Actions Variables:**',
54+
'- `CPLN_ORG_STAGING`: Control Plane authentication token',
55+
'- `CPLN_ORG_PRODUCTION`: Control Plane authentication token',
56+
'',
57+
'**Required GitHub Actions Variables (these need to match your control_plane.yml file:**',
58+
'- `PRODUCTION_APP_NAME`: Control Plane production app name',
59+
'- `STAGING_APP_NAME`: Control Plane staging app name',
60+
'- `REVIEW_APP_PREFIX`: Control Plane review app prefix',
61+
'',
62+
'**Optional Configuration:**',
63+
'- `WAIT_TIMEOUT`: Deployment timeout in seconds (default: 900)',
64+
' - Must be a positive integer',
65+
' - Can be set in GitHub Actions variables',
66+
' - Applies to both deployment and workload readiness checks',
67+
'',
68+
'### `/delete-review-app`',
69+
'Deletes the review app associated with this PR.',
70+
'- Removes all resources from Control Plane',
71+
'- Helpful for cleaning up when you\'re done testing',
72+
'- Can be re-deployed later using `/deploy-review-app`',
73+
'',
74+
'**Required Environment Variables:**',
75+
'- `CPLN_TOKEN`: Control Plane authentication token',
76+
'- `CPLN_ORG`: Control Plane organization name',
77+
'',
78+
'### `/help`',
79+
'Shows this detailed help message.',
80+
'',
81+
'---',
82+
'## Environment Setup',
83+
'',
84+
'1. Set required secrets in your repository settings:',
85+
' - `CPLN_TOKEN`',
86+
' - `CPLN_ORG`',
87+
'',
88+
'2. Optional: Configure `WAIT_TIMEOUT` in GitHub Actions variables to customize deployment timeout',
89+
'',
90+
'## Control Plane Integration',
91+
'',
92+
'Review apps are deployed to Control Plane with the following configuration:',
93+
'- App Name Format: `qa-react-webpack-rails-tutorial-pr-{PR_NUMBER}`',
94+
'- Console URL: `https://console.cpln.io/console/org/{CPLN_ORG}/gvc/{APP_NAME}/-info`',
95+
'',
96+
'## Automatic Cleanup',
97+
'',
98+
'Review apps are automatically deleted when:',
99+
'- The PR is closed (merged or not merged)',
100+
'- The PR is stale (via nightly cleanup job)',
101+
'',
102+
'For more information, see the [React on Rails Tutorial documentation](https://github.com/shakacode/react-on-rails/tree/master/react-webpack-rails-tutorial)'
103+
].join('\n');
104+
105+
await github.rest.issues.createComment({
106+
owner: context.repo.owner,
107+
repo: context.repo.repo,
108+
issue_number: context.issue.number,
109+
body: helpMessage
110+
});
111+
112+
console.log('Help message posted successfully');
113+
} catch (error) {
114+
console.error('Error posting help message:', error);
115+
core.setFailed(`Failed to post help message: ${error.message}`);
116+
}

.github/workflows/nightly-remove-stale-review-apps.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: actions/checkout@v4
2020

2121
- name: Setup Environment
22-
uses: ./.github/actions/setup-environment
22+
uses: ./.github/actions/setup-environment@justin808-working-for-deploys
2323

2424
- name: Get Stale PRs
2525
id: stale_prs

.github/workflows/promote-staging-to-production.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: actions/checkout@v4
2424

2525
- name: Setup Environment
26-
uses: ./.github/actions/setup-environment
26+
uses: ./.github/actions/setup-environment@justin808-working-for-deploys
2727
env:
2828
CPLN_TOKEN: ${{ secrets.CPLN_TOKEN }}
2929

.github/workflows/review-app-help.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ jobs:
3232
'Remove the review app when done',
3333
'',
3434
'### `/help`',
35-
'Show detailed instructions, environment setup, and configuration options.'
35+
'Show detailed documentation',
3636
'',
3737
'---',
38+
'**Note:** Type `/help` for detailed instructions, environment setup, and configuration options.'
3839
].join('\n');
3940
4041
await github.rest.issues.createComment({

0 commit comments

Comments
 (0)