Created
November 21, 2022 11:01
-
-
Save StoneyEagle/782b61c345a5ff44e0977a5fcb7c5394 to your computer and use it in GitHub Desktop.
Digital Ocean deploy script
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
/* eslint-disable no-undef */ | |
/* eslint-disable @typescript-eslint/no-var-requires */ | |
const { readFileSync } = require('fs'); | |
const { Client } = require('node-scp'); | |
const { join } = require('path'); | |
const env = require('dotenv'); | |
env.config(); | |
Client({ | |
host: process.env.DO_HOST, | |
port: 22, | |
username: process.env.DO_USER, | |
privateKey: readFileSync(join(process.env.USERPROFILE, '.ssh', process.env.DO_KEYFILE)), | |
passphrase: process.env.DO_PASS, | |
}).then((client) => { | |
client.uploadDir(join(__dirname, '..', '..', 'dist', 'app'), '/root/stack/beta') | |
.then(() => { | |
client.close(); | |
}) | |
.catch((error) => { | |
console.log(error); | |
}); | |
}) | |
.catch(e => console.log(e)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment