-
Notifications
You must be signed in to change notification settings - Fork 9
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
motion: Add deployments #1110
Merged
Merged
motion: Add deployments #1110
Changes from 8 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f5e4737
Add preliminary boxel-motion deployment setup
backspace 2989af0
Remove staging deployments
backspace d2f6944
Fix Cloudfront identifiers
backspace 520823e
Fix location of deployment configuration
backspace 5c435f9
Restore host commands
backspace c4d6cbd
Remove staging setup
backspace 09d4254
Remove unused deployment target
backspace 8359d65
Revert another mistaken change
backspace 0fc898b
Merge branch 'main' into motion/deploy-cs-6635
backspace 65a095c
Update to deploy to staging
backspace 3ce94b1
Add frontend change
backspace d69458c
Remove change
backspace 814f455
Add links to README
backspace 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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Deploy boxel-motion with ember | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
environment: | ||
required: true | ||
type: string | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
concurrency: deploy-motion-${{ inputs.environment }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Init | ||
uses: ./.github/actions/init | ||
|
||
- name: Set up env | ||
env: | ||
INPUT_ENVIRONMENT: ${{ inputs.environment }} | ||
run: | | ||
echo "AWS_REGION=us-east-1" >> $GITHUB_ENV | ||
if [ "$INPUT_ENVIRONMENT" = "production" ]; then | ||
echo "AWS_ROLE_ARN=arn:aws:iam::120317779495:role/boxel-motion" >> $GITHUB_ENV | ||
echo "AWS_S3_BUCKET=cardstack-boxel-motion-production" >> $GITHUB_ENV | ||
echo "AWS_CLOUDFRONT_DISTRIBUTION=E33N4WQHDRTVBM" >> $GITHUB_ENV | ||
else | ||
echo "unrecognized environment" | ||
exit 1; | ||
fi | ||
- name: Build boxel-motion addon | ||
run: pnpm build | ||
working-directory: packages/boxel-motion/addon | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v3 | ||
with: | ||
role-to-assume: ${{ env.AWS_ROLE_ARN }} | ||
aws-region: us-east-1 | ||
|
||
- name: Deploy | ||
run: pnpm deploy:boxel-motion ${{ inputs.environment }} --verbose | ||
|
||
- name: Send notification to Discord | ||
uses: cardstack/gh-actions/discord-notification-deploy@main | ||
with: | ||
app: "boxel-motion" | ||
status: ${{ job.status }} | ||
environment: ${{ inputs.environment }} | ||
webhook: ${{ secrets.DISCORD_WEBHOOK }} |
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
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: CI [boxel-motion] | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "packages/boxel-motion/**" | ||
- ".github/workflows/pr-boxel-motion.yml" | ||
- "package.json" | ||
- "pnpm-lock.yaml" | ||
|
||
permissions: | ||
contents: read | ||
issues: read | ||
checks: write | ||
pull-requests: write | ||
id-token: write | ||
statuses: write | ||
|
||
jobs: | ||
check-if-requires-preview: | ||
name: Check if a preview deploy is required | ||
runs-on: ubuntu-latest | ||
outputs: | ||
boxel-motion-files-changed: ${{ steps.boxel-motion-files-that-changed.outputs.any_changed }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Get boxel-motion files that changed | ||
id: boxel-motion-files-that-changed | ||
uses: tj-actions/changed-files@v39 | ||
with: | ||
files: | | ||
packages/boxel-motion/** | ||
|
||
deploy-motion-preview-production: | ||
name: Deploy a boxel-motion production preview to S3 | ||
runs-on: ubuntu-latest | ||
# github.event.pull_request.head.repo.full_name == github.repository: true if pr is from the original repo, false if it's from a fork | ||
# github.head_ref: the branch that the pull request is from. only appears on pull_request events | ||
if: github.event.pull_request.head.repo.full_name == github.repository && github.head_ref && needs.check-if-requires-preview.outputs.boxel-motion-files-changed == 'true' | ||
needs: check-if-requires-preview | ||
concurrency: deploy-motion-preview-production | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v3 | ||
with: | ||
role-to-assume: arn:aws:iam::120317779495:role/boxel-motion | ||
aws-region: us-east-1 | ||
- name: Deploy boxel-motion preview | ||
uses: ./.github/actions/deploy-ember-preview | ||
env: | ||
S3_PREVIEW_BUCKET_NAME: boxel-motion-preview.cardstack.com | ||
AWS_S3_BUCKET: boxel-motion-preview.cardstack.com | ||
AWS_REGION: us-east-1 | ||
AWS_CLOUDFRONT_DISTRIBUTION: E1LZQB073YSRH | ||
with: | ||
package: boxel-motion | ||
environment: production |
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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* eslint-env node */ | ||
|
||
module.exports = function (deployTarget) { | ||
let ENV = { | ||
pipeline: { | ||
activateOnDeploy: true, | ||
}, | ||
plugins: ['build', 'smart-compress', 'revision-data', 's3', 'cloudfront'], | ||
build: {}, | ||
s3: { | ||
allowOverwrite: true, | ||
bucket: process.env.AWS_S3_BUCKET, | ||
region: process.env.AWS_REGION, | ||
filePattern: '**/*', | ||
}, | ||
cloudfront: { | ||
objectPaths: ['/*'], | ||
distribution: process.env.AWS_CLOUDFRONT_DISTRIBUTION, | ||
}, | ||
}; | ||
|
||
if (deployTarget === 'production') { | ||
ENV.build.environment = 'production'; | ||
} | ||
|
||
if (deployTarget === 's3-preview-production') { | ||
ENV.s3.prefix = process.env.PR_BRANCH_NAME; | ||
} | ||
|
||
return ENV; | ||
}; |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.
Same question as infra PR about whether to use this domain