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

[BIOMAGE-1989]- Reduce UI build time #770

Merged
merged 8 commits into from
Jul 12, 2022
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
26 changes: 15 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,15 @@ jobs:
env:
CI: true
steps:
- id: setup-node
uses: actions/setup-node@v2
with:
node-version: '14'

- id: checkout
name: Check out source code
uses: actions/checkout@v2
uses: actions/checkout@v3

- id: cache-seek
name: Check for npm cache hit
uses: c-hive/gha-npm-cache@v1
- id: setup-node
uses: actions/setup-node@v3
with:
node-version: '14'
cache: 'npm'

- id: install
name: Install dependencies
Expand Down Expand Up @@ -133,7 +130,7 @@ jobs:
steps:
- id: checkout
name: Check out source code
uses: actions/checkout@v2
uses: actions/checkout@v3

- id: download-build-out
name: Download Next.js build output
Expand Down Expand Up @@ -205,6 +202,10 @@ jobs:
env:
REPO_NAME: ${{ steps.ref.outputs.repo-name }}

- id: setup-buildx
name: Set up Docker Buildx
Comment on lines +205 to +206
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I saw from the error in this run: https://github.com/hms-dbmi-cellenics/ui/runs/7291171952?check_suite_focus=true and read about it from the docker/build-push-action section about driver: https://github.com/docker/build-push-action#usage

uses: docker/setup-buildx-action@v2

- id: build
name: Build Docker image
uses: docker/build-push-action@v2
Expand All @@ -214,7 +215,10 @@ jobs:
platforms: linux/amd64
tags: ${{ format('{0}/{1}:{2}', steps.login-ecr.outputs.registry, steps.ref.outputs.repo-name, steps.ref.outputs.image-tag) }}
push: false
load: true
build-args: READONLY_API_TOKEN_GITHUB=${{ secrets.READONLY_API_TOKEN_GITHUB }}
cache-from: type=gha
cache-to: type=gha,mode=max
Comment on lines +220 to +221
Copy link
Member

Choose a reason for hiding this comment

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

how did you work out that we need to have these parameters?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I learned that the docker/build-push-action has internal caching capabilities and we're not using it. It has an option for github actions, and I'm following the examples here: https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#github-cache


- id: push
name: Push docker image to ECR
Expand Down Expand Up @@ -246,7 +250,7 @@ jobs:
steps:
- id: checkout
name: Check out source code
uses: actions/checkout@v2
uses: actions/checkout@v3

- id: setup-aws
name: Configure AWS credentials
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/nextjs_bundle_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: checkout
name: Check out source code
uses: actions/checkout@v3

- name: Set up node
uses: actions/setup-node@v1
- id: setup-node
uses: actions/setup-node@v3
with:
node-version: "14.x"

- name: Check for npm cache hit
uses: c-hive/gha-npm-cache@v1
node-version: '14'
cache: 'npm'

- name: Install dependencies
run: |-
Expand Down