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

chore: version bump #1954

Closed
wants to merge 2 commits into from
Closed
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
8 changes: 6 additions & 2 deletions .github/workflows/release-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ jobs:
tags: |
${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_SHA_TAG }}-release-${{ env.POSTFIX }}

# This is kind of "hacky", but we were having problems with the Dockerfile doing a
# correct build for Storybook. This will build it on the runner and then just copy
# over the folder
deploy-storybook-site:
needs: [setup, login]
runs-on: ubuntu-latest
Expand All @@ -147,6 +150,9 @@ jobs:
# pulls all commits (needed for lerna / semantic release to correctly version)
fetch-depth: "0"

- name: Build Storybook
run: 'NODE_OPTIONS=--openssl-legacy-provider yarn build:react'

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
Expand All @@ -173,8 +179,6 @@ jobs:
POSTFIX: ${{ needs.setup.outputs.postfix }}
with:
file: ./packages/sage-react/Dockerfile
build-args: |
GITHUB_TOKEN=${{ secrets.ACCESS_TOKEN }}
context: ./packages/sage-react/
push: true
tags: |
Expand Down
25 changes: 7 additions & 18 deletions packages/sage-react/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ FROM alpine:3.17.0
ARG NONROOT_UID="1000"
ARG NONROOT_GID="1000"
ARG NODE_VERSION="18.20.4"
ARG YARN_VERSION="1.22.18"
ARG ARCH="x64"
ARG GITHUB_TOKEN

RUN apk add \
bash \
Expand All @@ -15,36 +13,27 @@ RUN apk add \
libxml2-dev \
libxslt-dev \
tzdata \
# Install node and yarn
# Install node
&& curl -fsSLO --compressed "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" \
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
&& rm node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz \
&& npm -g install yarn@${YARN_VERSION} \
&& apk del --force-broken-world \
&& rm -f /var/cache/apk/* \
&& addgroup -g $NONROOT_GID -S nonroot \
&& adduser -u $NONROOT_UID -S nonroot -G nonroot -h /workspace
&& adduser -u $NONROOT_UID -S nonroot -G nonroot -h /workspace \
&& npm install -g serve


RUN mkdir -p /app && chown nonroot:nonroot /app

WORKDIR /app
ENV HOME="/app"

ENV PORT ${PORT:-4100}
ENV NODE_PATH=lib

RUN echo "-----> Using .npmrc from config"
RUN npm config set @kajabi:registry https://npm.pkg.github.com
RUN npm config set '//npm.pkg.github.com/:_authToken' '${GITHUB_TOKEN}'

COPY --chown={$NONROOT_UID}:${NONROOT_GID} package.json /app/package.json
RUN yarn install --check-files

COPY --chown={$NONROOT_UID}:${NONROOT_GID} .babelrc /app/.babelrc
COPY --chown={$NONROOT_UID}:${NONROOT_GID} lib /app/lib
COPY --chown={$NONROOT_UID}:${NONROOT_GID} .storybook /app/.storybook
COPY --chown={$NONROOT_UID}:${NONROOT_GID} public /app/public
COPY --chown={$NONROOT_UID}:${NONROOT_GID} build /app/build

EXPOSE $PORT

CMD [ "yarn", "run", "storybook"]
CMD [ "serve", "/app/build" ]
Loading