-
Notifications
You must be signed in to change notification settings - Fork 3
Next.js Prod deployment #1706
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
Merged
Merged
Next.js Prod deployment #1706
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f0211ef
Merge `main` into `nextjs` (#1687)
jonkafton 885f40c
restoring up and down chevrons (#1690)
shanbady 00976e7
Config to set cache control headers (#1700)
jonkafton 0fd7185
Copy yarn releases to the Docker container (fixes build) (#1703)
jonkafton 251ca07
NextJS - re-enable program letter tests (#1696)
shanbady 85d46d5
remove unnecessary webpack customizations (#1704)
ChristopherChudzicki 861c127
Increase cache duration (#1705)
jonkafton 3ab1467
Prod deployment. Add Posthog vars
jonkafton 2d308c5
NextJS Sentry Integration (#1701)
ChristopherChudzicki 1cfd475
Merge branch 'nextjs' into jk/5738-ci-config-nextjs-prod
jonkafton 8b6dde9
Appzi env vars and Sentry config
jonkafton dd03951
Merge branch 'nextjs' into jk/5738-ci-config-nextjs-prod
jonkafton b4f7d9b
Move deploy jobs to respective workflow. Docker build for dry run
jonkafton c4f01aa
Merge branch 'nextjs' into jk/5738-ci-config-nextjs-prod
jonkafton 6e1277a
Reinstate backend release steps
jonkafton d943275
Remove unnecessary Heroku vars
jonkafton 0c5a8b4
Read Sentry rates from the Actions secrets
jonkafton 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 hidden or 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 |
|---|---|---|
|
|
@@ -155,58 +155,51 @@ jobs: | |
| with: | ||
| file: coverage/lcov.info | ||
|
|
||
| build-deploy-frontend: | ||
| build-nextjs-container: | ||
| needs: javascript-tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
|
|
||
| - name: Heroku login | ||
| env: | ||
| HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | ||
| run: heroku container:login | ||
|
|
||
| - name: Build the Docker image | ||
| env: | ||
| HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | ||
| EMBEDLY_KEY: ${{ secrets.EMBEDLY_KEY_RC }} | ||
| ORIGIN: https://next.rc.learn.mit.edu | ||
| MITOL_API_BASE_URL: https://api.rc.learn.mit.edu | ||
| SITE_NAME: MIT Learn | ||
| SUPPORT_EMAIL: mitlearn-support@mit.edu | ||
| EMBEDLY_KEY: ${{ secrets.EMBEDLY_KEY_RC }} | ||
| MITOL_AXIOS_WITH_CREDENTIALS: true | ||
| CSRF_COOKIE_NAME: learn-rc-csrftoken | ||
| NEXT_PUBLIC_SENTRY_DSN: ${{ secrets.SENTRY_DSN_RC }} | ||
| NEXT_PUBLIC_SENTRY_ENV: rc | ||
| NEXT_PUBLIC_SENTRY_PROFILES_SAMPLE_RATE: 0.0 | ||
| NEXT_PUBLIC_SENTRY_TRACES_SAMPLE_RATE: 0.0 | ||
| NEXT_PUBLIC_VERSION: ${{ github.sha }} | ||
| NEXT_PUBLIC_POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY_RC }} | ||
| CSRF_COOKIE_NAME: ${{ secrets.CSRF_COOKIE_NAME_RC }} | ||
| POSTHOG_API_HOST: https://app.posthog.com | ||
| POSTHOG_PROJECT_ID: ${{ secrets.POSTHOG_PROJECT_ID_RC }} | ||
| POSTHOG_API_KEY: ${{ secrets.POSTHOG_PROJECT_API_KEY_RC }} | ||
| SENTRY_DSN: ${{ secrets.SENTRY_DSN_RC }} | ||
| SENTRY_ENV: ${{ secrets.MITOL_ENVIRONMENT_RC }} | ||
| SENTRY_PROFILES_SAMPLE_RATE: ${{ secrets.SENTRY_PROFILES_SAMPLE_RATE_RC }} | ||
| SENTRY_TRACES_SAMPLE_RATE: ${{ secrets.SENTRY_TRACES_SAMPLE_RATE_RC }} | ||
| APPZI_URL: ${{ secrets.APPZI_URL_RC }} | ||
| VERSION: ${{ github.sha }} | ||
| run: | | ||
| heroku container:push web \ | ||
| --app mitopen-rc-nextjs \ | ||
| --recursive \ | ||
| --arg NEXT_PUBLIC_ORIGIN=$ORIGIN,\ | ||
| NEXT_PUBLIC_MITOL_API_BASE_URL=$MITOL_API_BASE_URL,\ | ||
| NEXT_PUBLIC_SITE_NAME="$SITE_NAME",\ | ||
| NEXT_PUBLIC_MITOL_SUPPORT_EMAIL=$SUPPORT_EMAIL,\ | ||
| NEXT_PUBLIC_EMBEDLY_KEY=$EMBEDLY_KEY,\ | ||
| NEXT_PUBLIC_MITOL_AXIOS_WITH_CREDENTIALS=$MITOL_AXIOS_WITH_CREDENTIALS,\ | ||
| NEXT_PUBLIC_CSRF_COOKIE_NAME=$CSRF_COOKIE_NAME,\ | ||
| NEXT_PUBLIC_VERSION=$NEXT_PUBLIC_VERSION,\ | ||
| NEXT_PUBLIC_SENTRY_DSN=$NEXT_PUBLIC_SENTRY_DSN,\ | ||
| NEXT_PUBLIC_SENTRY_ENV=$NEXT_PUBLIC_SENTRY_ENV,\ | ||
| NEXT_PUBLIC_SENTRY_PROFILES_SAMPLE_RATE=$NEXT_PUBLIC_SENTRY_PROFILES_SAMPLE_RATE,\ | ||
| NEXT_PUBLIC_SENTRY_TRACES_SAMPLE_RATE=$NEXT_PUBLIC_SENTRY_TRACES_SAMPLE_RATE,\ | ||
| NEXT_PUBLIC_POSTHOG_API_KEY=$NEXT_PUBLIC_POSTHOG_API_KEY \ | ||
| --context-path . | ||
|
|
||
| - name: Release on Heroku | ||
| if: github.ref == 'refs/heads/nextjs' | ||
| env: | ||
| HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | ||
| run: heroku container:release --app mitopen-rc-nextjs web | ||
| docker build \ | ||
| -f frontends/main/Dockerfile.web \ | ||
| --build-arg NEXT_PUBLIC_ORIGIN=$ORIGIN \ | ||
| --build-arg NEXT_PUBLIC_MITOL_API_BASE_URL=$MITOL_API_BASE_URL \ | ||
| --build-arg NEXT_PUBLIC_SITE_NAME="$SITE_NAME" \ | ||
| --build-arg NEXT_PUBLIC_MITOL_SUPPORT_EMAIL=$SUPPORT_EMAIL \ | ||
| --build-arg NEXT_PUBLIC_EMBEDLY_KEY=$EMBEDLY_KEY \ | ||
| --build-arg NEXT_PUBLIC_MITOL_AXIOS_WITH_CREDENTIALS=$MITOL_AXIOS_WITH_CREDENTIALS \ | ||
| --build-arg NEXT_PUBLIC_CSRF_COOKIE_NAME=$CSRF_COOKIE_NAME \ | ||
| --build-arg NEXT_PUBLIC_POSTHOG_API_HOST=$POSTHOG_API_HOST \ | ||
| --build-arg NEXT_PUBLIC_POSTHOG_PROJECT_ID=$POSTHOG_PROJECT_ID \ | ||
| --build-arg NEXT_PUBLIC_POSTHOG_API_KEY=$POSTHOG_API_KEY \ | ||
| --build-arg NEXT_PUBLIC_SENTRY_DSN=$SENTRY_DSN \ | ||
| --build-arg NEXT_PUBLIC_SENTRY_ENV=$SENTRY_ENV \ | ||
| --build-arg NEXT_PUBLIC_SENTRY_PROFILES_SAMPLE_RATE=$SENTRY_PROFILES_SAMPLE_RATE \ | ||
|
Contributor
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. noting that this appears to currently be hardcoded to 0 in the env section |
||
| --build-arg NEXT_PUBLIC_SENTRY_TRACES_SAMPLE_RATE=$SENTRY_TRACES_SAMPLE_RATE \ | ||
| --build-arg NEXT_PUBLIC_APPZI_URL=$APPZI_URL \ | ||
| --build-arg NEXT_PUBLIC_VERSION=$VERSION \ | ||
| -t mitodl/mit-learn-frontend:$VERSION . | ||
|
|
||
| build-storybook: | ||
| runs-on: ubuntu-latest | ||
|
|
||
This file contains hidden or 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 hidden or 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
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.
I'd be happy to just remove this step—we have
yarn workspace main buildabove. (Which, annoyingly, we do need to run separately. It has to run before typecheck. vercel/next.js#53959 (comment))If you want to keep it, I would remove the heroku vars.
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.
The intention is to catch issues building the container before that happens on the release branches, but:
heroku container:push(they don't have a build only / dry run command).It would be good to have some check on the docker build before we get to
release-candidate. Can we rethink once this is released? Good call with Heroku vars - removed.