Skip to content

Commit

Permalink
Merge pull request #1706 from mitodl/jk/5738-ci-config-nextjs-prod
Browse files Browse the repository at this point in the history
* Merge `main` into `nextjs` (#1687)

* Add location field to LearningResource and LearningResourceRun models (#1604)

* Always delete past events during ETL, and filter them out from api results too just in case (#1660)

* Release 0.21.1

* Release date for 0.21.1

* remove unnecessary padding adjustment on Input base styles (#1666)

* remove unnecessary padding adjustment on Input base styles

* adjust actual textarea padding to match Figma

* Content File Score Adjustment (#1667)

* Release 0.21.2

* Restore program letter intercept view (#1643)

* Restore program letter intercept view

* Generate schema

* Fix test

* fixing import

* Revert "fixing import"

This reverts commit cf56807.

---------

Co-authored-by: shankar ambady <[email protected]>

* Release date for 0.21.2

* topic detail banner / subtopic logic revisions (#1646)

* add new darker chip variant

* move subtopic display to the banner

* remove max width on banner subtitle texts

* query subtopics only on parent topic channels, and on child topic channels query "related topics" aka the topic's siblings

* don't display the current topic in related topics

* show parent topic breadcrumbs on child topic channel pages

* fix tests

* only do subtopics mocking if necessary

* fix editchannelpage test

* move action buttons under the title on mobile

* fix test

* add new default channel background image

* "toopics"

* fix background position

* remove accidentally committed file

* fix background size on mobile

* remove unnecessary order css rule

* fix banner background on mobile

* fix breadcrumb props

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove unnecessary topic id filter

* remove unnecessary breadcrumb fallback

* set the default banner background image in the banner component itself, and only apply large and up 140% background size if the default image is being used

* properly set default background image

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Update Yarn to v4.5.0 (#1624)

* Update Yarn to v4.5.0

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Clear Cache on Deploy (#1668)

* adding initial cache clear command

* adding cache clear command to heroku release script

* fix docstrings

* removing invalid flag from clear cache command (#1675)

* prevent featured course carousel from re-randomizing (#1673)

* use skipFeatured when invalidating userlists / learning paths after update

* add a new function for updating query data for user_list_parents and learning_path_parents on the featured courses list when either is edited without re-randomizing

* fix learning path invalidations

* fix test

* Shuffling around where the search_update event is fired so it happens in more places (#1679)

- Changed HeroSearch to use the SearchField component instead of SearchInput, so we get the event capture stuff
- Updated SearchInput to not require setPage (for use on the homepage)
- Moved facet events out of the SearchPage and into SearchDisplay so they get called on other pages that use it
- Also trigger the facet events on more things - should also now get sorting changes, choosing between categories, and clearing facets

* Reinstate background steps image

---------

Co-authored-by: Matt Bertrand <[email protected]>
Co-authored-by: Doof <[email protected]>
Co-authored-by: Carey P Gumaer <[email protected]>
Co-authored-by: Anastasia Beglova <[email protected]>
Co-authored-by: Nathan Levesque <[email protected]>
Co-authored-by: shankar ambady <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Shankar Ambady <[email protected]>
Co-authored-by: James Kachel <[email protected]>

* restoring up and down chevrons (#1690)

* Config to set cache control headers (#1700)

* Middleware to set cache headers

* Set headers in the config

* Upgrade Next.js

* Regex to exclude paths with a file extension to apply only to routes

* Remove middleware file

* Instruct to only store in shared cache (not browsers)

* Copy yarn releases to the Docker container (fixes build) (#1703)

* Copy yarn releases

* Build the docker image on all push

* NextJS - re-enable program letter tests (#1696)

* fixing program letter template

* re-enabling test

* adding space

* remove unnecessary webpack customizations (#1704)

* Increase cache duration (#1705)

* Increase cache durations

* Update comment

* Prod deployment. Add Posthog vars

* NextJS Sentry Integration (#1701)

* configure sentry, fix error pages

* add env vars to CI

* add global styles to global-error

* TEMPORARY self destruct button

* cleanup

* cleanup error boundary, other misc cleanup

* remove a few useless things

* add a simple test i guess

* remove intentional error triggers

* Appzi env vars and Sentry config

* Move deploy jobs to respective workflow. Docker build for dry run

---------

Co-authored-by: Matt Bertrand <[email protected]>
Co-authored-by: Doof <[email protected]>
Co-authored-by: Carey P Gumaer <[email protected]>
Co-authored-by: Anastasia Beglova <[email protected]>
Co-authored-by: Nathan Levesque <[email protected]>
Co-authored-by: shankar ambady <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Shankar Ambady <[email protected]>
Co-authored-by: James Kachel <[email protected]>
Co-authored-by: Chris Chudzicki <[email protected]>
  • Loading branch information
12 people authored Oct 21, 2024
2 parents 8c879a9 + 0c5a8b4 commit 6965103
Show file tree
Hide file tree
Showing 11 changed files with 196 additions and 138 deletions.
69 changes: 31 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
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 \
--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
Expand Down
96 changes: 55 additions & 41 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,64 +19,78 @@ jobs:
with:
ref: release

- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: "^20"
cache: yarn
cache-dependency-path: yarn.lock
- name: Set VERSION
run: echo "VERSION=$(./scripts/get_version.sh)" >> $GITHUB_ENV

- name: Setup environment
run: sudo apt-get install libelf1
- name: Write commit SHA to file
run: echo $GITHUB_SHA > frontends/main/public/hash.txt

- name: Install frontend dependencies
run: yarn install --immutable
- name: Heroku login
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:login

- name: Set VERSION
run: echo "VERSION=$(./scripts/get_version.sh)" >> $GITHUB_ENV
- name: Release Backend on Heroku
uses: akhileshns/heroku-deploy@581dd286c962b6972d427fcf8980f60755c15520
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: mitopen-production
heroku_email: ${{ secrets.HEROKU_EMAIL }}
branch: release

- name: Build frontend
run: NODE_ENV=production yarn build
- name: Build and push the Docker image
env:
HEROKU_APP_NAME: mitopen-production-nextjs
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
ORIGIN: https://learn.mit.edu
MITOL_API_BASE_URL: https://api.learn.mit.edu
SITE_NAME: MIT Learn
SUPPORT_EMAIL: [email protected]
EMBEDLY_KEY: ${{ secrets.EMBEDLY_KEY_PROD }}
POSTHOG_ENABLED: true
MITOL_AXIOS_WITH_CREDENTIALS: true
CSRF_COOKIE_NAME: ${{ secrets.CSRF_COOKIE_NAME_PROD }}
POSTHOG_API_HOST: https://app.posthog.com
POSTHOG_TIMEOUT_MS: 1000
POSTHOG_PROJECT_ID: ${{ secrets.POSTHOG_PROJECT_ID_PROD }}
POSTHOG_PROJECT_API_KEY: ${{ secrets.POSTHOG_PROJECT_API_KEY_PROD }}
POSTHOG_API_KEY: ${{ secrets.POSTHOG_PROJECT_API_KEY_PROD }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN_PROD }}
SENTRY_ENV: ${{ secrets.MITOL_ENVIRONMENT_PROD }}
SENTRY_PROFILES_SAMPLE_RATE: ${{ secrets.SENTRY_PROFILES_SAMPLE_RATE_PROD }}
SENTRY_TRACES_SAMPLE_RATE: ${{ secrets.SENTRY_TRACES_SAMPLE_RATE_PROD }}
APPZI_URL: ${{ secrets.APPZI_URL_PROD }}
CSRF_COOKIE_NAME: ${{ secrets.CSRF_COOKIE_NAME_PROD }}
MITOL_AXIOS_WITH_CREDENTIALS: true
MITOL_API_BASE_URL: https://api.learn.mit.edu
MITOL_SUPPORT_EMAIL: [email protected]

- uses: akhileshns/heroku-deploy@581dd286c962b6972d427fcf8980f60755c15520
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: "mitopen-production"
heroku_email: ${{ secrets.HEROKU_EMAIL }}
branch: release
VERSION: ${{ github.sha }}
run: |
heroku container:push web \
--app $HEROKU_APP_NAME \
--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_POSTHOG_API_HOST=$POSTHOG_API_HOST,\
NEXT_PUBLIC_POSTHOG_PROJECT_ID=$POSTHOG_PROJECT_ID,\
NEXT_PUBLIC_POSTHOG_API_KEY=$POSTHOG_API_KEY,\
NEXT_PUBLIC_SENTRY_DSN=$SENTRY_DSN,\
NEXT_PUBLIC_SENTRY_ENV=$SENTRY_ENV,\
NEXT_PUBLIC_SENTRY_PROFILES_SAMPLE_RATE=$SENTRY_PROFILES_SAMPLE_RATE,\
NEXT_PUBLIC_SENTRY_TRACES_SAMPLE_RATE=$SENTRY_TRACES_SAMPLE_RATE,\
NEXT_PUBLIC_APPZI_URL=$APPZI_URL,\
NEXT_PUBLIC_VERSION=$VERSION \
--context-path .
- name: Write commit SHA to file
run: echo $GITHUB_SHA > frontends/mit-learn/build/static/hash.txt

- name: Upload frontend build to s3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks
- name: Release Frontend on Heroku
env:
AWS_S3_BUCKET: ol-mitlearn-app-storage-production
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_PROD }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_PROD }}
SOURCE_DIR: "frontends/mit-learn/build" # optional: defaults to entire repository
DEST_DIR: "frontend" # This dir will get cluttered but it is okay for now
HEROKU_APP_NAME: mitopen-production-nextjs
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:release --app $HEROKU_APP_NAME web

- name: Purge Fastly cache
uses: jcoene/fastly-purge-action@master
with:
api_key: "${{ secrets.FASTLY_API_KEY_PROD }}"
service_id: "${{ secrets.FASTLY_SERVICE_ID_PROD }}"
api_key: "${{ secrets.FASTLY_API_KEY_PROD_NEXTJS }}"
service_id: "${{ secrets.FASTLY_SERVICE_ID_PROD_NEXTJS }}"

# runs ONLY on a failure of the CI workflow
on-failure:
Expand Down
96 changes: 55 additions & 41 deletions .github/workflows/release-candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,64 +19,78 @@ jobs:
with:
ref: release-candidate

- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: "^20"
cache: yarn
cache-dependency-path: yarn.lock
- name: Set VERSION
run: echo "VERSION=$(./scripts/get_version.sh)" >> $GITHUB_ENV

- name: Setup environment
run: sudo apt-get install libelf1
- name: Write commit SHA to file
run: echo $GITHUB_SHA > frontends/main/public/hash.txt

- name: Install frontend dependencies
run: yarn install --immutable
- name: Heroku login
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:login

- name: Set VERSION
run: echo "VERSION=$(./scripts/get_version.sh)" >> $GITHUB_ENV
- name: Release Backend on Heroku
uses: akhileshns/heroku-deploy@581dd286c962b6972d427fcf8980f60755c15520
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: mitopen-rc
heroku_email: ${{ secrets.HEROKU_EMAIL }}
branch: release-candidate

- name: Build frontend
run: NODE_ENV=production yarn build
- name: Build and push the Docker image
env:
HEROKU_APP_NAME: mitopen-rc-nextjs
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
ORIGIN: https://next.rc.learn.mit.edu
MITOL_API_BASE_URL: https://api.rc.learn.mit.edu
SITE_NAME: MIT Learn
SUPPORT_EMAIL: [email protected]
EMBEDLY_KEY: ${{ secrets.EMBEDLY_KEY_RC }}
POSTHOG_ENABLED: true
MITOL_AXIOS_WITH_CREDENTIALS: true
CSRF_COOKIE_NAME: ${{ secrets.CSRF_COOKIE_NAME_RC }}
POSTHOG_API_HOST: https://app.posthog.com
POSTHOG_TIMEOUT_MS: 1000
POSTHOG_PROJECT_ID: ${{ secrets.POSTHOG_PROJECT_ID_RC }}
POSTHOG_PROJECT_API_KEY: ${{ secrets.POSTHOG_PROJECT_API_KEY_RC }}
POSTHOG_API_KEY: ${{ secrets.POSTHOG_PROJECT_API_KEY_RC }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN_RC }}
SENTRY_ENV: ${{ secrets.MITOL_ENVIRONMENT_RC }}
CSRF_COOKIE_NAME: ${{ secrets.CSRF_COOKIE_NAME_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 }}
MITOL_AXIOS_WITH_CREDENTIALS: true
MITOL_API_BASE_URL: https://api.rc.learn.mit.edu
MITOL_SUPPORT_EMAIL: [email protected]

- uses: akhileshns/heroku-deploy@581dd286c962b6972d427fcf8980f60755c15520
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: "mitopen-rc"
heroku_email: ${{ secrets.HEROKU_EMAIL }}
branch: release-candidate
VERSION: ${{ github.sha }}
run: |
heroku container:push web \
--app $HEROKU_APP_NAME \
--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_POSTHOG_API_HOST=$POSTHOG_API_HOST,\
NEXT_PUBLIC_POSTHOG_PROJECT_ID=$POSTHOG_PROJECT_ID,\
NEXT_PUBLIC_POSTHOG_API_KEY=$POSTHOG_API_KEY,\
NEXT_PUBLIC_SENTRY_DSN=$SENTRY_DSN,\
NEXT_PUBLIC_SENTRY_ENV=$SENTRY_ENV,\
NEXT_PUBLIC_SENTRY_PROFILES_SAMPLE_RATE=$SENTRY_PROFILES_SAMPLE_RATE,\
NEXT_PUBLIC_SENTRY_TRACES_SAMPLE_RATE=$SENTRY_TRACES_SAMPLE_RATE,\
NEXT_PUBLIC_APPZI_URL=$APPZI_URL,\
NEXT_PUBLIC_VERSION=$VERSION \
--context-path .
- name: Write commit SHA to file
run: echo $GITHUB_SHA > frontends/mit-learn/build/static/hash.txt

- name: Upload frontend build to s3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks
- name: Release Frontend on Heroku
env:
AWS_S3_BUCKET: ol-mitlearn-app-storage-rc
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_RC }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_RC }}
SOURCE_DIR: "frontends/mit-learn/build" # optional: defaults to entire repository
DEST_DIR: "frontend" # This dir will get cluttered but it is okay for now
HEROKU_APP_NAME: mitopen-rc-nextjs
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:release --app $HEROKU_APP_NAME web

- name: Purge Fastly cache
uses: jcoene/fastly-purge-action@master
with:
api_key: "${{ secrets.FASTLY_API_KEY_RC }}"
service_id: "${{ secrets.FASTLY_SERVICE_ID_RC }}"
api_key: "${{ secrets.FASTLY_API_KEY_RC_NEXTJS }}"
service_id: "${{ secrets.FASTLY_SERVICE_ID_RC_NEXTJS }}"

# runs ONLY on a failure of the CI workflow
on-failure:
Expand Down
Loading

0 comments on commit 6965103

Please sign in to comment.