Skip to content
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

[Issue: 1291] Update cd-* scripts to deploy staging #1821

Merged
merged 4 commits into from
Apr 30, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/cd-analytics.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Deploy Analytics
# Need to set a default value for when the workflow is triggered from a git push
# which bypasses the default configuration for inputs
run-name: Deploy ${{ github.ref_name }} to Analytics ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'dev' }}
run-name: Deploy ${{ github.ref_name }} to Analytics ${{ inputs.environment || (github.event_name == 'release' && 'prod') || fromJSON('["dev", "staging"]')}}

on:
push:
Expand Down Expand Up @@ -35,4 +35,4 @@ jobs:
uses: ./.github/workflows/deploy.yml
with:
app_name: "analytics"
environment: ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'dev' }}
environment: ${{ inputs.environment || (github.event_name == 'release' && 'prod') || fromJSON('["dev", "staging"]') }}
5 changes: 3 additions & 2 deletions .github/workflows/cd-api.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Deploy API
# Need to set a default value for when the workflow is triggered from a git push
# which bypasses the default configuration for inputs
run-name: Deploy ${{ github.ref_name }} to API ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'dev' }}
run-name: Deploy ${{ github.ref_name }} to API ${{ inputs.environment || (github.event_name == 'release' && 'prod') || fromJSON('["dev", "staging"]') }}

on:
push:
Expand All @@ -20,6 +20,7 @@ on:
type: choice
options:
- dev
- staging
- prod

jobs:
Expand All @@ -33,4 +34,4 @@ jobs:
uses: ./.github/workflows/deploy.yml
with:
app_name: "api"
environment: ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'dev' }}
environment: ${{ inputs.environment || (github.event_name == 'release' && 'prod') || fromJSON('["dev", "staging"]') }}
6 changes: 3 additions & 3 deletions .github/workflows/cd-frontend.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Deploy Frontend
# Need to set a default value for when the workflow is triggered from a git push
# which bypasses the default configuration for inputs
run-name: Deploy ${{ github.ref_name }} to Frontend ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'dev' }}

run-name: Deploy ${{ github.ref_name }} to Frontend ${{ inputs.environment || (github.event_name == 'release' && 'prod') || fromJSON('["dev", "staging"]') }}
on:
push:
branches:
Expand All @@ -20,6 +19,7 @@ on:
type: choice
Copy link
Collaborator

Choose a reason for hiding this comment

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

You'll need to change run-name: above as well

options:
- dev
- staging
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unfortunately adding staging here won't change much. It just makes staging available as an option, but doesn't actually start deploying staging. The line you want to change is down below...

- prod

Copy link
Collaborator

Choose a reason for hiding this comment

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

...the line you want to change is this one down below

environment: ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'dev' }}

change it to (psuedo-code)

environment: ${{ inputs.environment || (github.event_name == 'release' && 'prod') || ['dev', 'staging'] }}

Copy link
Collaborator

Choose a reason for hiding this comment

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

You'll need to do this for the analytics package as well, of course.

jobs:
Expand All @@ -33,4 +33,4 @@ jobs:
uses: ./.github/workflows/deploy.yml
with:
app_name: "frontend"
environment: ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'dev' }}
environment: ${{ inputs.environment || (github.event_name == 'release' && 'prod') || fromJSON('["dev", "staging"]') }}
Loading