Skip to content

Commit

Permalink
Misc dev (#86)
Browse files Browse the repository at this point in the history
* Simplify devspace config

* Tweak theme

* Disable username spellcheck, adjust margins

* Update dependencies

* Update dependencies

* Update dependencies

* Use new cookie auth strategy

* Add nginx reminder todo

* Update dependencies

* Update to node 15.5.0

* Upgrade setup-node action

* Add sharp dep (required by next 10)

* Use multistage build with full fat node image

* Update sharp

* Add nginx ingress controller

* Update dependencies

* Remove cors mode

* Specify local hosts

* Use port 80

* Remove docker build target

* Add urql index

* Move theme under theme/

* Import client from root urql module

* Move graphql types under urql/

* Add ingress-nginx and cert-manager deployments

* Update dependencies

* Add link styling

* Add sign up/log in navigations

* Push to base route on sign up/log in success

* Use graphcache

* Update react hook form

* Update node types

* Add logout mutation type gen

* Add letsencrypt issuer deployments

* Correct generated exclude path

* Use container for initial sync

* Update eslint

* Update dependencies

* Generate type for the me query

* Single stage dockerfile

* Update all dependencies

* Simplify devspace for local dev only

* Remove version field

* Redo workflows

* Add yamls for flux deployment
  • Loading branch information
ben-walker authored Jan 12, 2021
1 parent bc605ab commit 4d58ffa
Show file tree
Hide file tree
Showing 21 changed files with 3,071 additions and 2,605 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
/build

# Generated Code
generated
/src/urql/graphql-types.ts
18 changes: 0 additions & 18 deletions .github/workflows/check-container-build.yaml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/deploy-production.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2-beta
- uses: actions/setup-node@v2.1.4
with:
node-version: 15.x

Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
pull_request:
push:
tags:
- v*

jobs:
container:
name: Container
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Generate container metadata
uses: crazy-max/ghaction-docker-meta@v1
id: container_meta
with:
images: ghcr.io/pokernook/web
tag-latest: false
tag-semver: |
{{version}}
- uses: docker/setup-buildx-action@v1

- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}

- uses: docker/build-push-action@v2
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.container_meta.outputs.tags }}
labels: ${{ steps.container_meta.outputs.labels }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Semantic Analysis
name: Scan

on:
push:
Expand All @@ -7,8 +7,8 @@ on:
- cron: "0 0 * * *"

jobs:
run-codeql:
name: Run CodeQL
codeql:
name: CodeQL
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:15.4.0-alpine
FROM node:15.5.1-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci
Expand Down
2 changes: 1 addition & 1 deletion codegen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ overwrite: true
documents: src/**/*.graphql

generates:
src/generated/graphql.ts:
src/urql/graphql-types.ts:
plugins:
- add:
content: |
Expand Down
43 changes: 43 additions & 0 deletions deploy/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: v1
kind: Service
metadata:
name: web
namespace: flux-system
spec:
type: ClusterIP
selector:
app: web
ports:
- name: http
port: 80
targetPort: http
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
namespace: flux-system
spec:
selector:
matchLabels:
app: web
replicas: 1
strategy:
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
template:
metadata:
labels:
app: web
spec:
containers:
- name: web
image: ghcr.io/pokernook/web:0.0.1 # {"$imagepolicy": "flux-system:graph"}
resources:
limits:
memory: 128Mi
cpu: 500m
ports:
- name: http
containerPort: 3000
4 changes: 4 additions & 0 deletions deploy/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- app.yaml
65 changes: 38 additions & 27 deletions devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: v1beta9

images:
web:
image: registry.digitalocean.com/pokernook/web
image: devspace/pokernook/web
tags:
- sha-${DEVSPACE_GIT_COMMIT}-${DEVSPACE_RANDOM}
cmd: ["npm", "run", "dev"]
Expand All @@ -12,52 +12,63 @@ images:
useBuildKit: true

deployments:
- name: pokernook-web
- name: ingress-nginx
helm:
chart:
name: ingress-nginx
repo: https://kubernetes.github.io/ingress-nginx
version: "3.18.0"
wait: true
- name: cert-manager
helm:
chart:
name: cert-manager
repo: https://charts.jetstack.io
version: "1.1.0"
wait: true
values:
installCRDs: true
- name: web
helm:
componentChart: true
values:
containers:
- image: registry.digitalocean.com/pokernook/web
- image: devspace/pokernook/web
env:
- name: NEXT_PUBLIC_GRAPHQL_URL
value: http://pokernook-graph:4000
value: http://local.graph.pokernook.com
- name: GRAPHQL_SCHEMA_PATH
value: http://pokernook-graph:4000
value: http://pokernook-graph
service:
ports:
- port: 3000

dependencies:
- source:
git: https://github.com/pokernook/graph
branch: main

profiles:
- name: production
patches:
- op: remove
path: images.web.cmd
- op: remove
path: dependencies
- op: remove
path: deployments.name=pokernook-web.helm.values.containers[0].env.name=GRAPHQL_SCHEMA_PATH
- port: 80
containerPort: 3000
ingress:
ingressClass: nginx
rules:
- host: local.pokernook.com
- host: local.graph.pokernook.com
serviceName: pokernook-graph
servicePort: 80
annotations:
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/cors-allow-origin: "http://local.pokernook.com"

dev:
ports:
- imageName: web
forward:
- port: 3000
open:
- url: http://localhost:3000
sync:
- imageName: web
initialSync: preferRemote # Initial GraphQL types download
excludePaths:
- Dockerfile
- node_modules
- .git/
uploadExcludePaths:
- /.next/
- node_modules
- generated
- "**/*.graphql"
uploadExcludePaths:
- "**/graphql-types.ts"
- logs
- "**/*.log"
- npm-debug.log*
Expand Down
Loading

0 comments on commit 4d58ffa

Please sign in to comment.