Skip to content

Commit

Permalink
🔨⬆️ deploy server
Browse files Browse the repository at this point in the history
  • Loading branch information
ky-is committed Sep 7, 2021
1 parent da1800c commit fc214b0
Show file tree
Hide file tree
Showing 3 changed files with 211 additions and 151 deletions.
20 changes: 20 additions & 0 deletions build/deploy.js
@@ -0,0 +1,20 @@
import { copySync, moveSync } from 'fs-extra'
import path from 'path'

const DEPLOY_DIR = 'factions-server-deploy'

function copy(internalPath, externalPath) {
const destPath = path.join('..', DEPLOY_DIR, externalPath ?? internalPath)
copySync(internalPath, destPath)
}

function move(internalPath, externalPath) {
const destPath = path.join('..', DEPLOY_DIR, externalPath ?? internalPath)
moveSync(internalPath, destPath, { overwrite: true })
}

// Run

copy('package.json')
copy('~$dist/common', 'common')
copy('~$dist/server', 'server')
22 changes: 12 additions & 10 deletions package.json
Expand Up @@ -7,33 +7,35 @@
"client:dev": "vite client",
"server:run": "tsc --project server/tsconfig.json && node './~$dist/server/index.js'",
"client:build": "vite build client --emptyOutDir",
"server:build": "tsc --project server/tsconfig.json"
"server:build": "tsc --project server/tsconfig.json",
"server:deploy": "git -C ../factions-server-deploy reset --hard && tsc --project server/tsconfig.json && node build/deploy && echo `date` && git -C ../factions-server-deploy add . && git -C ../factions-server-deploy commit -m \"🚀\" && git -C ../factions-server-deploy push dokku main && echo `date`"
},
"dependencies": {
"esm-seedrandom": "3.0.5",
"fastify": "^3.20.2",
"fastify": "^3.21.0",
"postgres": "^2.0.0-beta.8",
"socket.io": "^4.2.0"
},
"devDependencies": {
"@ky-is/eslint-config": "^2.3.6",
"@tailwindcss/forms": "^0.3.3",
"@types/node": "^16.7.10",
"@types/node": "^16.7.13",
"@types/seedrandom": "^3.0.1",
"@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/parser": "^4.30.0",
"@vitejs/plugin-vue": "^1.6.0",
"@vue/compiler-sfc": "^3.2.8",
"@typescript-eslint/eslint-plugin": "^4.31.0",
"@typescript-eslint/parser": "^4.31.0",
"@vitejs/plugin-vue": "^1.6.1",
"@vue/compiler-sfc": "^3.2.10",
"@vue/eslint-config-typescript": "^7.0.0",
"autoprefixer": "^10.3.4",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^7.17.0",
"fs-extra": "^10.0.0",
"postcss": "^8.3.6",
"socket.io-client": "^4.2.0",
"tailwindcss": "^2.2.9",
"tailwindcss": "^2.2.11",
"typescript": "^4.4.2",
"vite": "^2.5.3",
"vue": "^3.2.8",
"vite": "^2.5.4",
"vue": "^3.2.10",
"vue-router": "^4.0.11"
},
"eslintConfig": {
Expand Down

0 comments on commit fc214b0

Please sign in to comment.