Skip to content

Instantly share code, notes, and snippets.

@Zeko369
Last active July 15, 2020 14:51
Show Gist options
  • Save Zeko369/c86c4c2311bccb55a52da3d750e91435 to your computer and use it in GitHub Desktop.
Save Zeko369/c86c4c2311bccb55a52da3d750e91435 to your computer and use it in GitHub Desktop.
name: Deploy
on:
push:
branches: [master]
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- run: "ssh-keyscan HOSTNAME >> ~/.ssh/known_hosts"
- run: yarn
- run: git checkout yarn.lock
- run: yarn deploy
module.exports = {
apps: [
{
script: "./node_modules/.bin/ts-node",
args: "--project router/tsconfig.json ./router/index.ts",
},
{
script: "./node_modules/.bin/blitz",
args: "start --production -H 0.0.0.0 -p 3232",
},
],
deploy: {
production: {
user: "zeko",
host: "HOST",
ref: "origin/master",
repo: "[email protected]:Zeko369/url_shortener.git",
path: "/home/zeko/url",
"pre-deploy-local": "",
"post-deploy": "./scripts/postdeploy.sh",
"pre-setup": "",
},
},
}
server {
server_name stuff.domain.com;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://localhost:3232;
}
listen 80;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment