Skip to content

Commit

Permalink
Merge pull request #21 from ngregrichardson/v2
Browse files Browse the repository at this point in the history
V2
  • Loading branch information
ngregrichardson authored Feb 28, 2024
2 parents 91177eb + fee5b9c commit fa6c5c2
Show file tree
Hide file tree
Showing 98 changed files with 1,305 additions and 13,111 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
build
Dockerfile*
docker-compose*
.dockerignore
.gitignore
README.md
.vscode
13 changes: 13 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
30 changes: 30 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'prettier'
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
extraFileExtensions: ['.svelte']
},
env: {
browser: true,
es2017: true,
node: true
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
]
};
24 changes: 12 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
name: Deploy
name: Deploy to Production

on:
push:
branches: [main]
workflow_dispatch:

env:
INFISICAL_TOKEN: ${{ secrets.INFISICAL_TOKEN }}

jobs:
deploy:
runs-on: [self-hosted, primary]
runs-on: [self-hosted, prod]
timeout-minutes: 5

steps:
- uses: actions/checkout@v2
- name: Clone Project
uses: actions/checkout@v3

- name: Build Service
run: docker compose build

- name: Stop Docker
run: |
docker stop portfolio
docker rm portfolio
continue-on-error: true
- name: Build Docker Image
run: docker build -t portfolio .
- name: Start Docker
run: docker run -d -p 3000:3000 --name portfolio portfolio
- name: Start Service
run: docker rollout portfolio
33 changes: 9 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

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

/.idea
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
5 changes: 5 additions & 0 deletions .infisical.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"workspaceId": "820a955f-81f9-4bb9-8f55-3758a2b74d9e",
"defaultEnvironment": "",
"gitBranchToEnvironmentMapping": null
}
13 changes: 13 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
36 changes: 29 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
FROM node:16-alpine
FROM oven/bun:alpine as base
WORKDIR /app
COPY package.json ./
COPY yarn.lock ./
RUN yarn install
COPY . ./

RUN apk add --no-cache bash curl && curl -1sLf \
'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.alpine.sh' | bash \
&& apk add infisical

FROM base as install
RUN mkdir -p /temp/dev
COPY package.json bun.lockb /temp/dev/
RUN cd /temp/dev && bun install --frozen-lockfile

RUN mkdir -p /temp/prod
COPY package.json bun.lockb /temp/prod/
RUN cd /temp/prod && bun install --frozen-lockfile --production

FROM base as prerelease
COPY --from=install /temp/dev/node_modules node_modules
COPY . .

ENV NODE_ENV=production
RUN bun run build

FROM base AS release
COPY --from=install /temp/prod/node_modules node_modules
COPY --from=prerelease /app/build build
COPY package.json .infisical.json ./

EXPOSE 3000
RUN yarn build
CMD yarn serve

CMD infisical run --env=prod -- bun start
40 changes: 38 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,38 @@
# Portfolio
My personal website and online resume.
# create-svelte

Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).

## Creating a project

If you're seeing this, you've probably already done this step. Congrats!

```bash
# create a new project in the current directory
npm create svelte@latest

# create a new project in my-app
npm create svelte@latest my-app
```

## Developing

Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:

```bash
npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open
```

## Building

To create a production version of your app:

```bash
npm run build
```

You can preview the production build with `npm run preview`.

> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
Binary file added bun.lockb
Binary file not shown.
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3.8'
services:
portfolio:
build:
context: .
dockerfile: Dockerfile
image: portfolio
restart: always
expose:
- 3000
environment:
- INFISICAL_TOKEN
labels:
traefik.http.routers.portfolio.rule: Host(`iamnoah.dev`)
traefik.http.routers.portfolio.entrypoints: web
82 changes: 39 additions & 43 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,47 @@
{
"name": "portfolio",
"version": "1.0.0",
"version": "0.0.1",
"private": true,
"dependencies": {
"@chakra-ui/react": "^1.2.1",
"@emotion/react": "^11.1.4",
"@emotion/styled": "^11.0.0",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"framer-motion": "^3.3.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-helmet": "^6.1.0",
"react-icons": "^4.1.0",
"react-pdf": "^5.1.0",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.2",
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"serve": "npx serve -l 3000 -s build"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
"dev": "infisical run --env=prod -- vite dev",
"build": "vite build",
"preview": "vite preview",
"start": "bun build/index.js",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write ."
},
"devDependencies": {
"prettier": "^2.2.1"
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/adapter-node": "^4.0.1",
"@sveltejs/kit": "^1.20.4",
"@types/chance": "^1.1.6",
"@types/luxon": "^3.3.2",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"autoprefixer": "^10.4.16",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-svelte": "^2.30.0",
"postcss": "^8.4.31",
"prettier": "^2.8.0",
"prettier-plugin-svelte": "^2.10.1",
"svelte": "^4.0.5",
"svelte-check": "^3.4.3",
"tailwindcss": "^3.3.3",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^4.4.2"
},
"type": "module",
"dependencies": {
"chance": "^1.1.11",
"lucide-svelte": "^0.279.0",
"luxon": "^3.4.3",
"resend": "^3.2.0",
"svelte-turnstile": "^0.5.0",
"zod": "^3.22.4",
"zod-form-data": "^2.0.2"
}
}
6 changes: 6 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
Binary file removed public/favicon.ico
Binary file not shown.
23 changes: 0 additions & 23 deletions public/index.html

This file was deleted.

Binary file removed public/logo192.png
Binary file not shown.
Binary file removed public/logo512.png
Binary file not shown.
Loading

0 comments on commit fa6c5c2

Please sign in to comment.