Skip to content

Commit

Permalink
feat: it is important to commit your work frequently, not weekly
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsMeBrianD committed Mar 26, 2024
1 parent f5ecd0c commit 81df9f4
Show file tree
Hide file tree
Showing 118 changed files with 2,403 additions and 449 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.env
50 changes: 50 additions & 0 deletions .github/workflows/build-and-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and Deploy Monorepo

on:
push:
branches:
# - 'preview/**'
# - 'dev/**'
# - 'staging/**'
# - 'main'
- v2

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Build and Push Image
run: |
docker build -t ghcr.io/${{ github.repository }}:${{ github.sha }} .
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
docker push ghcr.io/${{ github.repository }}:${{ github.sha }}
- name: Extract Environment
id: extract-env
run: |
BRANCH_NAME=${GITHUB_REF##*/}
if [[ $BRANCH_NAME =~ ^preview/ ]]; then
ENV="preview"
elif [[ $BRANCH_NAME =~ ^dev/ ]]; then
ENV="dev"
elif [[ $BRANCH_NAME =~ ^staging/ ]]; then
ENV="staging"
else
ENV="main"
fi
echo "::set-output name=env::$ENV"
- name: Update Nomad Job
run: |
IMAGE_TAG=ghcr.io/${{ github.repository }}:${{ github.sha }}
sed -i "s#__IMAGE_TAG__#$IMAGE_TAG#g" nomad.job.hcl
- name: Deploy to Nomad
uses: hashicorp/nomad-github-action@v1
with:
nomad_addr: ${{ secrets.NOMAD_ADDR }}
nomad_token: ${{ secrets.NOMAD_TOKEN }}
command: job run nomad.job.hcl
8 changes: 0 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,15 @@ dist

# TernJS port file
.tern-port

*.iml

.idea/

.run/

clients/image-generation-frontend/build/

clients/image-generation-frontend/src/ca-certificate.cer

clients/image-generation-frontend/src/config.json

core/config/development.json.bak

core/config/main.json

core/config/staging.json

# Vim/Emacs backup files
Expand Down
8 changes: 4 additions & 4 deletions .graphqlrc.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
projects:
default:
web-client:
schema:
- ./clients/web/schema.graphql
- ./clients/web/$houdini/graphql/schema.graphql
documents:
- './clients/web/**/*.gql'
- './clients/web/**/*.svelte'
- ./clients/web/$houdini/graphql/documents.gql
- "./clients/web/**/*.gql"
- "./clients/web/**/*.svelte"
- "./clients/web/$houdini/graphql/documents.gql"
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM oven/bun:1.0.30-alpine as build

ENV PUBLIC_API_PORT=443
ENV PUBLIC_API_URL=api.preview.spr.ocket.gg
ENV PUBLIC_API_SECURE=true

COPY . /app
WORKDIR /app
RUN bun i
RUN cd /app/core && bun run build
RUN cd /app/lib && bun run build
RUN cd /app/services/matchmaking && bun run build
RUN cd /app/clients/discord && bun run build


FROM node:20-alpine

ENV PUBLIC_API_PORT=443
ENV PUBLIC_API_URL=api.preview.spr.ocket.gg
ENV PUBLIC_API_SECURE=true

COPY --from=build /app /app
RUN cd /app/clients/web && npm run build
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

ENTRYPOINT [ "/entrypoint.sh" ]
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion clients/web/.graphqlrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ projects:
documents:
- '**/*.gql'
- '**/*.svelte'
- ./$houdini/graphql/documents.gql
- ./$houdini/graphql/documents.gql
6 changes: 2 additions & 4 deletions clients/web/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"prettier.documentSelectors": [
"**/*.svelte"
],
"prettier.documentSelectors": ["**/*.svelte"],
"tailwindCSS.classAttributes": [
"class",
"accent",
Expand Down Expand Up @@ -117,4 +115,4 @@
"width",
"zIndex"
]
}
}
21 changes: 11 additions & 10 deletions clients/web/houdini.config.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
/** @type {import('houdini').ConfigFile} */
const config = {
"watchSchema": {
"url": (env) => {
// Use URL to remove the port if it matches the protocol (e.g. 443 doesn't need to be specified if it's https)
watchSchema: {
url: (env) => {
// Use URL to remove the port if it matches the protocol (e.g. 443 doesn't need to be specified if it's https)
const rawUrl = new URL(
`${env.PUBLIC_API_SECURE.toLowerCase() === 'true' ? 'https' : 'http'}://${env.PUBLIC_API_URL}:${env.PUBLIC_API_PORT}`
`${env.PUBLIC_API_SECURE.toLowerCase() === 'true' ? 'https' : 'http'}://${env.PUBLIC_API_URL}:${env.PUBLIC_API_PORT ?? 443}`
).toString();
// Remove the trailing '/' to make it easier to work with
const apiUrl = rawUrl.endsWith('/') ? rawUrl.substring(0, rawUrl.length - 1) : rawUrl;
console.log(`Using Houdini (config) API @ ${apiUrl}/graphql`)
return `${apiUrl}/graphql`
console.log(`Using Houdini (config) API @ ${apiUrl}/graphql`);
return `${apiUrl}/graphql`;
},
interval: 1000
},
"plugins": {
"houdini-svelte": {}
// schemaPath: path.join(`${import.meta.dirname}`, 'schema.graphql'),
plugins: {
'houdini-svelte': {}
}
}
};

export default config
export default config;
103 changes: 52 additions & 51 deletions clients/web/package.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,53 @@
{
"name": "@sprocketbot/web",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"format": "prettier --write ."
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@types/eslint": "^8.56.0",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.35.1",
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"svelte": "^4.2.7",
"svelte-check": "^3.6.0",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^5.0.3",
"postcss": "8.4.35",
"autoprefixer": "10.4.18",
"tailwindcss": "3.4.1",
"@skeletonlabs/skeleton": "2.9.0",
"@skeletonlabs/tw-plugin": "0.3.1",
"vite-plugin-tailwind-purgecss": "0.2.0",
"@tailwindcss/typography": "0.5.10",
"@tailwindcss/forms": "0.5.7",
"@types/node": "20.11.24",
"houdini": "^1.2.43",
"houdini-svelte": "^1.2.43"
},
"type": "module",
"dependencies": {
"@floating-ui/dom": "^1.6.3",
"@sprocketbot/lib": "workspace:*",
"@steeze-ui/phosphor-icons": "^2.0.3",
"@steeze-ui/simple-icons": "^1.7.1",
"@steeze-ui/svelte-icon": "^1.5.0",
"valibot": "^0.30.0"
}
}
"name": "@sprocketbot/web",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"format": "prettier --write ."
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@types/eslint": "^8.56.0",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.35.1",
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"svelte": "^4.2.7",
"svelte-check": "^3.6.0",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^5.0.3",
"postcss": "8.4.35",
"autoprefixer": "10.4.18",
"tailwindcss": "3.4.1",
"@skeletonlabs/skeleton": "2.9.0",
"@skeletonlabs/tw-plugin": "0.3.1",
"vite-plugin-tailwind-purgecss": "0.2.0",
"@tailwindcss/typography": "0.5.10",
"@tailwindcss/forms": "0.5.7",
"@types/node": "20.11.24",
"houdini": "^1.2.43",
"houdini-svelte": "^1.2.43"
},
"type": "module",
"dependencies": {
"@floating-ui/dom": "^1.6.3",
"@sprocketbot/lib": "workspace:*",
"@steeze-ui/phosphor-icons": "^2.0.3",
"@steeze-ui/simple-icons": "^1.7.1",
"@steeze-ui/svelte-icon": "^1.5.0",
"@sveltejs/adapter-node": "^5.0.1",
"valibot": "^0.30.0"
}
}
6 changes: 3 additions & 3 deletions clients/web/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
autoprefixer: {}
}
};
2 changes: 1 addition & 1 deletion clients/web/src/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// and what to do when importing types
declare namespace App {
interface Locals {
authToken?: string
authToken?: string;
}
interface PageData {
// You cannot use import/export at the root level, must be written this way or the file stops working
Expand Down
4 changes: 3 additions & 1 deletion clients/web/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover" data-theme="my-custom-theme">
<div style="display: contents" class="h-screen w-screen overflow-x-hidden">%sveltekit.body%</div>
<div style="display: contents" class="h-screen w-screen overflow-x-hidden">
%sveltekit.body%
</div>
</body>
</html>
14 changes: 10 additions & 4 deletions clients/web/src/app.postcss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
@tailwind utilities;
@tailwind variants;

html, body, body > div {
html,
body,
body > div {
width: 100vw;
height: 100vh;
overflow-x: hidden;
Expand All @@ -13,10 +15,14 @@ html, body, body > div {
}

[data-theme='my-custom-theme'] {
background-image: radial-gradient(at 0% 100%, rgba(var(--color-secondary-500) / 0.1) 0px, transparent 80%),
radial-gradient(at 98% 100%, rgba(var(--color-primary-500) / 0.1) 0px, transparent 80%);
background-image: radial-gradient(
at 0% 100%,
rgba(var(--color-secondary-500) / 0.1) 0px,
transparent 80%
),
radial-gradient(at 98% 100%, rgba(var(--color-primary-500) / 0.1) 0px, transparent 80%);
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
}
Loading

0 comments on commit 81df9f4

Please sign in to comment.