Skip to content

Commit

Permalink
Marketing Website 2.0 (#475)
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinejaussoin authored Feb 22, 2023
1 parent dad60ac commit 4c69831
Show file tree
Hide file tree
Showing 271 changed files with 16,983 additions and 4 deletions.
44 changes: 43 additions & 1 deletion .github/workflows/alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,39 @@ jobs:
tags: retrospected/backend:alpha
platforms: linux/amd64
push: true

marketing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Read VERSION
id: package
uses: martinbeentjes/npm-get-version-action@master
- name: Echo VERSION
run: echo ${{ steps.package.outputs.current-version }}
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Setup BuildX
uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_NEW_USERNAME }}
password: ${{ secrets.DOCKER_NEW_PASSWORD }}
- name: Build and push Marketing
uses: docker/build-push-action@v4
with:
builder: ${{ steps.buildx.outputs.name }}
file: marketing/Dockerfile
context: marketing
tags: retrospected/marketing:alpha
platforms: linux/amd64
push: true

integration:
runs-on: ubuntu-latest
Expand All @@ -88,7 +121,7 @@ jobs:

trivy:
runs-on: ubuntu-latest
needs: [frontend, backend]
needs: [frontend, backend, marketing]
steps:
- name: Trivy - Frontend
uses: aquasecurity/trivy-action@master
Expand All @@ -108,4 +141,13 @@ jobs:
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL'
- name: Trivy - Marketing
uses: aquasecurity/trivy-action@master
with:
image-ref: retrospected/marketing:alpha
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL'

44 changes: 43 additions & 1 deletion .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,39 @@ jobs:
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true

marketing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Read VERSION
id: package
uses: martinbeentjes/npm-get-version-action@master
- name: Echo VERSION
run: echo ${{ steps.package.outputs.current-version }}
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Setup BuildX
uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_NEW_USERNAME }}
password: ${{ secrets.DOCKER_NEW_PASSWORD }}
- name: Build and push Marketing
uses: docker/build-push-action@v4
with:
builder: ${{ steps.buildx.outputs.name }}
file: marketing/Dockerfile
context: marketing
tags: retrospected/marketing:canary
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true

maintenance:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -154,7 +187,7 @@ jobs:

trivy:
runs-on: ubuntu-latest
needs: [frontend, backend]
needs: [frontend, backend, marketing]
steps:
- name: Trivy - Frontend
uses: aquasecurity/trivy-action@master
Expand All @@ -174,4 +207,13 @@ jobs:
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL'
- name: Trivy - Marketing
uses: aquasecurity/trivy-action@master
with:
image-ref: retrospected/marketing:canary
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL'

39 changes: 39 additions & 0 deletions .github/workflows/marketing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'Marketing Build'

on:
push:
branches: [v5000/marketing-final]

jobs:
marketing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Read VERSION
id: package
uses: martinbeentjes/npm-get-version-action@master
- name: Echo VERSION
run: echo ${{ steps.package.outputs.current-version }}
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Setup BuildX
uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_NEW_USERNAME }}
password: ${{ secrets.DOCKER_NEW_PASSWORD }}
- name: Build and push Marketing
uses: docker/build-push-action@v4
with:
builder: ${{ steps.buildx.outputs.name }}
file: marketing/Dockerfile
context: marketing
tags: retrospected/marketing:alpha
platforms: linux/amd64
push: true
33 changes: 33 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,39 @@ jobs:
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true

marketing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Read VERSION
id: package
uses: martinbeentjes/npm-get-version-action@master
- name: Echo VERSION
run: echo ${{ steps.package.outputs.current-version }}
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Setup BuildX
uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_NEW_USERNAME }}
password: ${{ secrets.DOCKER_NEW_PASSWORD }}
- name: Build and push Marketing
uses: docker/build-push-action@v4
with:
builder: ${{ steps.buildx.outputs.name }}
file: marketing/Dockerfile
context: marketing
tags: retrospected/marketing:${{ steps.package.outputs.current-version }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true

maintenance:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ node_modules
build
persist
configuration.json
assets
# assets
stats
.vscode
.DS_Store
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ local:
docker build -f ./backend/Dockerfile -t retrospected/backend:local ./backend
docker build -f ./frontend/Dockerfile -t retrospected/frontend:local ./frontend

marketing-build:
docker build -f ./marketing/Dockerfile -t retrospected/marketing:local ./marketing
docker run -it --rm -p 3333:80 retrospected/marketing:local

install-trivy:
brew install trivy

Expand Down
7 changes: 7 additions & 0 deletions marketing/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.env
.env.example
.env.local
.next
.node_modules
Makefile
yarn-error.log
3 changes: 3 additions & 0 deletions marketing/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copy to .env.local
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_MEASUREMENT_ID=G-XXXXXXXXXX
3 changes: 3 additions & 0 deletions marketing/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
36 changes: 36 additions & 0 deletions marketing/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
66 changes: 66 additions & 0 deletions marketing/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
FROM node:18-alpine AS base

# Install dependencies only when needed
FROM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app

# Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
RUN \
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
elif [ -f package-lock.json ]; then npm ci; \
elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
else echo "Lockfile not found." && exit 1; \
fi


# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .

# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry during the build.
# ENV NEXT_TELEMETRY_DISABLED 1

ARG NEXT_PUBLIC_MEASUREMENT_ID=APP_NEXT_PUBLIC_MEASUREMENT_ID
ARG NEXT_PUBLIC_APP_URL=APP_NEXT_PUBLIC_APP_URL
RUN yarn build

# If using npm comment out above and use below instead
# RUN npm run build

# Production image, copy all the files and run next
FROM base AS runner
WORKDIR /app

ENV NODE_ENV production
# Uncomment the following line in case you want to disable telemetry during runtime.
# ENV NEXT_TELEMETRY_DISABLED 1

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

COPY --from=builder /app/public ./public
COPY --from=builder /app/docker/entrypoint.sh ./entrypoint.sh

RUN ["chmod", "+x", "/app/entrypoint.sh"]

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

USER nextjs

EXPOSE 3000

ENV PORT 3000

ENTRYPOINT ["/app/entrypoint.sh"]

CMD ["node", "server.js"]
6 changes: 6 additions & 0 deletions marketing/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
run:
docker build -f ./Dockerfile -t retrospected/marketing:local ./
docker run \
--env NEXT_PUBLIC_MEASUREMENT_ID=G-BLAH \
--env NEXT_PUBLIC_APP_URL=http://localhost:3000 \
-it --rm -p 3333:3000 retrospected/marketing:local
38 changes: 38 additions & 0 deletions marketing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
Loading

0 comments on commit 4c69831

Please sign in to comment.