Skip to content

Commit

Permalink
ci(deploy): Add 'environment_url' (GH-1121)
Browse files Browse the repository at this point in the history
  • Loading branch information
433eros authored Feb 1, 2024
1 parent 3397a60 commit 4c519ef
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/actions/deploy-rails-app-to-aws/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@ runs:
else
echo "User did not select a release version to deploy."
echo -n "Querying API for latest "
if [[ "${{ github.event.inputs.environment }}" == *"(Production)"* ]]; then
echo -n "release version"
latest_github_release_ver=$(gh release view --json 'tagName' --jq '.tagName[1:]' | tr -d '\n')
elif [[ "${{ github.event.inputs.environment }}" == *"(Staging)"* ]]; then
# If environment name/URL contains ".staging." subdomain
if [[ "${{ github.event.inputs.environment }}" == *".staging."* ]]; then
echo -n "pre-release version"
latest_github_release_ver=$(gh release list | grep -oP 'Pre-release\s+v\K\d+\.\d+\.\d-pre\.\d+' | sort -uVr | head -n 1 | tr -d '\n')
# Otherwise assume that it's a production deployment environment
else
echo "Environment name must include the sub-string \"(Production)\" or \"(Staging)\" to indicate whether it is a staging or production stack"
test
echo -n "release version"
latest_github_release_ver=$(gh release view --json 'tagName' --jq '.tagName[1:]' | tr -d '\n')
fi
echo "..."
echo "Determined latest pre-release/release version is '$latest_github_release_ver'"
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/deploy_backend_to_aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
inputs:
environment:
type: environment
default: 'Authoring (Staging) - authoring.lara.staging.concord.org'
default: 'authoring.lara.staging.concord.org'
description: CloudFormation stack to deploy to
required: true
version:
Expand All @@ -24,7 +24,9 @@ jobs:
deploy:
name: 🚀 Deploy to '${{ inputs.environment }}'
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
environment:
name: ${{ inputs.environment }}
url: https://${{ inputs.environment }}
steps:
- name: 📥 Checkout project source
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/payload.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"inputs": {
"environment": "Authoring (Staging) - authoring.lara.staging.concord.org"
"environment": "authoring.lara.staging.concord.org"
}
}

0 comments on commit 4c519ef

Please sign in to comment.