From 49241f56144335f5ac27690c819837f8fe2bb444 Mon Sep 17 00:00:00 2001 From: Chris <15677803+c00ldude1oo@users.noreply.github.com> Date: Wed, 11 May 2022 18:49:45 -0400 Subject: [PATCH 1/3] Change to alpine base image --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ca782c441..d59093471 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,2 @@ -FROM nginx:1.21.6 -COPY ./out /usr/share/nginx/html \ No newline at end of file +FROM nginx:alpine +COPY ./out /usr/share/nginx/html From 3db65dbb1f1ca27b36d3ca08077c7444d3feae21 Mon Sep 17 00:00:00 2001 From: Chris <15677803+c00ldude1oo@users.noreply.github.com> Date: Wed, 11 May 2022 23:59:09 -0400 Subject: [PATCH 2/3] Update docker.yml Add cache for yarn and nextjs. `yarn install` takes about 25s off `yarn export` takes about 40s --- .github/workflows/docker.yml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 846055bdb..9bd9c872f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -15,11 +15,35 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/setup-node@v3 - - uses: actions/checkout@v3 + - name: Setup + uses: actions/setup-node@v3 + - name: Checkout + uses: actions/checkout@v3 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - name: Yarn cache + uses: actions/cache@v3 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: ${{ runner.os }}-yarn- + - name: Nextjs cache + uses: actions/cache@v2 + with: + # See here for caching with `yarn` https://github.com/actions/cache/blob/main/examples.md#node---yarn or you can leverage caching with actions/setup-node https://github.com/actions/setup-node + path: | + ~/.npm + ${{ github.workspace }}/.next/cache + # Generate a new cache whenever packages or source files change. + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} + # If source files changed but packages didn't, rebuild from a prior cache. + restore-keys: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- - run: yarn install --frozen-lockfile - run: yarn export - - uses: actions/cache@v2 + - name: Cache build output + uses: actions/cache@v2 id: restore-build with: path: ./out/ From 1f6b2756c49b36f3edf56c9aebf72eb5e7fc6663 Mon Sep 17 00:00:00 2001 From: Chris <15677803+c00ldude1oo@users.noreply.github.com> Date: Thu, 12 May 2022 02:05:59 -0400 Subject: [PATCH 3/3] Revert "Change to alpine base image" This reverts commit 49241f56144335f5ac27690c819837f8fe2bb444. --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d59093471..ca782c441 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,2 @@ -FROM nginx:alpine -COPY ./out /usr/share/nginx/html +FROM nginx:1.21.6 +COPY ./out /usr/share/nginx/html \ No newline at end of file