Skip to content

Commit 9b0e604

Browse files
committed
Merge branch 'main' into better-readme
2 parents 572949a + 2609de2 commit 9b0e604

40 files changed

+2191
-569
lines changed

.env.development.example

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
NEXTAUTH_SECRET=
2+
NEXTAUTH_URL=
3+
CLIENT_ID=
4+
CLIENT_SECRET=
5+
NEXT_PUBLIC_TOKEN=
6+
7+
# uncomment the “SENTRY” prefixed variables below if you are using sentry and need to catch errors in local dev
8+
# SENTRY_DSN=ref: https://docs.sentry.io/product/sentry-basics/concepts/dsn-explainer/#where-to-find-your-dsn
9+
# SENTRY_URL=https://sentry.io/
10+
# SENTRY_ORG= ref: https://github.com/getsentry/sentry-webpack-plugin#options (org)
11+
# SENTRY_PROJECT= ref: https://github.com/getsentry/sentry-webpack-plugin#options (project)
12+
# SENTRY_AUTH_TOKEN= ref: https://github.com/getsentry/sentry-webpack-plugin#options (authToken)

.env.local.example

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: 'Build Test Lint'
2+
run-name: Build Test Lint of ${{ github.ref_name }} by @${{ github.actor }}
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
inputs:
12+
debug_enabled:
13+
type: boolean
14+
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
15+
required: false
16+
default: false
17+
18+
jobs:
19+
build:
20+
uses: scientist-softserv/actions/.github/workflows/[email protected]
21+
secrets: inherit
22+
with:
23+
platforms: 'linux/amd64'
24+
webTarget: web
25+
cypress:
26+
runs-on: ubuntu-22.04
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
- name: Cypress e2e
31+
uses: cypress-io/github-action@v6
32+
with:
33+
start: yarn start
34+
wait-on: 'http://localhost:3000'
35+
eslint:
36+
needs: build
37+
uses: scientist-softserv/actions/.github/workflows/[email protected]
38+
with:
39+
lint_cmd: docker compose run web sh -c 'yarn && yarn lint'

.github/workflows/build.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
1-
# we are running the deploy through vercel now so we don't need this github action
2-
# TODO(alishaevn): fix any potential sentry error's if we switch from vercel to an in house deploy infrastructure
1+
# This webstore instance is currently deployed to: https://webstore-staging.vercel.app
2+
# In order to deploy via github actions instead, please update/confirm the following files:
3+
# - ops/production-deploy.tmpl.yaml
4+
# - ops/staging-deploy.tmpl.yaml
35

4-
# name: "Deploy"
5-
# run-name: Deploy (${{ github.ref_name }} -> ${{ inputs.environment }}) by @${{ github.actor }}
6-
# on:
7-
# workflow_dispatch:
8-
# inputs:
9-
# environment:
10-
# description: 'Deploy to Environment'
11-
# required: true
12-
# default: 'staging'
13-
# type: choice
14-
# options:
15-
# - staging
16-
# debug_enabled:
17-
# type: boolean
18-
# description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
19-
# required: false
20-
# default: false
6+
name: "Deploy"
7+
run-name: Deploy (${{ github.ref_name }} -> ${{ inputs.environment }}) by @${{ github.actor }}
8+
on:
9+
workflow_dispatch:
10+
inputs:
11+
environment:
12+
description: 'Deploy to Environment'
13+
required: true
14+
default: 'staging'
15+
type: choice
16+
options:
17+
- staging
18+
- production
19+
debug_enabled:
20+
type: boolean
21+
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
22+
required: false
23+
default: false
2124

22-
# jobs:
23-
# deploy:
24-
# uses: scientist-softserv/actions/.github/workflows/[email protected]
25-
# secrets: inherit
25+
jobs:
26+
deploy:
27+
# remove the line below to enable the job
28+
if: false
29+
uses: scientist-softserv/actions/.github/workflows/[email protected]
30+
secrets: inherit

.github/workflows/test-suite.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.gitignore

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,21 @@ node_modules/
44
# Next.js build output
55
.next
66

7-
# Where ENV secrets are stored. refer to the "Note" at the link below for details on the use of this file
8-
# https://nextjs.org/docs/basic-features/environment-variables#default-environment-variables
9-
.env.local
7+
# Where ENV secrets are stored. although NextJS uses `.env.local`
8+
# (https://nextjs.org/docs/basic-features/environment-variables#default-environment-variables), we are using `.env.development`
9+
# for consistency with other projects. this also ensures our CICD and docker processes work.
10+
.env.development
1011

1112
# we want the default npmrc but sometimes folks put in the gh tokens, don't commit those
1213
.npmrc
1314

1415
# Sentry
1516
.sentryclirc
17+
18+
# Emacs
19+
*.~undo-tree~
20+
21+
# Cypress
22+
cypress/results
23+
cypress/screenshots
24+
cypress/videos

Dockerfile

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,14 @@
1-
FROM node:18-alpine AS builder
2-
3-
ENV NODE_ENV=production \
4-
NEXT_TELEMETRY_DISABLED=1
5-
6-
WORKDIR /home/node/app
7-
8-
ADD . /home/node/app
9-
10-
# https://github.com/vercel/next.js/discussions/22149#discussioncomment-366180
11-
RUN yarn install && yarn build && npm prune --omit=dev
12-
13-
FROM node:18-alpine
1+
FROM node:18-alpine as web
142

153
ENV NODE_ENV="production" \
164
NEXT_TELEMETRY_DISABLED=1
175

186
WORKDIR /home/node/app
7+
RUN yarn add --dev eslint
198

20-
# https://javascript.plainenglish.io/reduce-docker-image-size-for-your-next-js-app-bcb65d322222
21-
# and
22-
# https://nextjs.org/docs/advanced-features/output-file-tracing
23-
COPY --from=builder /home/node/app/package.json /home/node/app/
24-
COPY --from=builder /home/node/app/yarn.lock /home/node/app/
25-
COPY --from=builder /home/node/app/next.config.js /home/node/app/
26-
COPY --from=builder /home/node/app/public /home/node/app/public
27-
COPY --from=builder /home/node/app/.next/standalone /home/node/app/
28-
COPY --from=builder /home/node/app/.next/static /home/node/app/.next/static
9+
COPY package.json yarn.lock /home/node/app/
10+
RUN yarn
2911

30-
CMD ["node", "server.js"]
12+
COPY . /home/node/app
13+
RUN yarn build
14+
CMD ["yarn", "start"]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,14 @@ There are 2 types of Cypress tests, e2e & component.
185185
If you are creating an e2e test, it will live in the `cypress/e2e` directory. Component tests will need to be created in a directory called `cypress/component `
186186

187187
#### Setup your Cypress env variables
188-
- the Cypress suite requires an environment variable that should be stored in your `.env.local` and not committed to git.
188+
- the Cypress suite requires an environment variable that should be stored in your `.env.development` and not committed to git.
189189
- TEST_SESSION_COOKIE=
190190
- to get the value for this variable, open your browser to your running app at `localhost:3000`.
191191
- inspect the page
192192
- click the "Application" tab
193193
- click "Cookies"
194194
- find the value for `next-auth.session-token`
195-
- copy that value and paste it in the `TEST_SESSION_COOKIE` variable in your .env.local
195+
- copy that value and paste it in the `TEST_SESSION_COOKIE` variable in your .env.development
196196
- do not ever commit this value
197197
- this value will need to be updated whenever the cookie expires, approximately once per month
198198

bin/helm_deploy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ helm upgrade \
2929
--namespace="$namespace" \
3030
--create-namespace \
3131
"$release_name" \
32-
./charts/webstore
32+
./charts/webstore

0 commit comments

Comments
 (0)