-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: it is important to commit your work frequently, not weekly
- Loading branch information
1 parent
f5ecd0c
commit 81df9f4
Showing
118 changed files
with
2,403 additions
and
449 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
} | ||
autoprefixer: {} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.