Add dockerfile, disable github actions
This commit is contained in:
parent
801a9d9707
commit
a7b562135c
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules
|
||||||
|
npm-debug.log
|
46
.github/workflows/dev_deploy.yaml
vendored
46
.github/workflows/dev_deploy.yaml
vendored
@ -1,25 +1,25 @@
|
|||||||
name: NodBot Dev Deploy
|
# name: NodBot Dev Deploy
|
||||||
|
|
||||||
on:
|
# on:
|
||||||
push: # tells github to run this on any push to the dev branch
|
# push: # tells github to run this on any push to the dev branch
|
||||||
branches:
|
# branches:
|
||||||
- dev
|
# - dev
|
||||||
|
|
||||||
jobs:
|
# jobs:
|
||||||
deploy:
|
# deploy:
|
||||||
runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
if: github.ref == 'refs/heads/dev' # we tell Github to only execute this step if we're on our dev branch
|
# if: github.ref == 'refs/heads/dev' # we tell Github to only execute this step if we're on our dev branch
|
||||||
steps:
|
# steps:
|
||||||
- name: Deploying to Probey
|
# - name: Deploying to Probey
|
||||||
uses: appleboy/ssh-action@master # An action made to control Linux servers
|
# uses: appleboy/ssh-action@master # An action made to control Linux servers
|
||||||
with: # We set all our secrets here for the action, these won't be shown in the action logs
|
# with: # We set all our secrets here for the action, these won't be shown in the action logs
|
||||||
host: ${{ secrets.HOST }}
|
# host: ${{ secrets.HOST }}
|
||||||
username: ${{ secrets.USERNAME }}
|
# username: ${{ secrets.USERNAME }}
|
||||||
key: ${{ secrets.KEY }}
|
# key: ${{ secrets.KEY }}
|
||||||
port: ${{ secrets.PORT }}
|
# port: ${{ secrets.PORT }}
|
||||||
script: |
|
# script: |
|
||||||
cd nodbot-dev # we move into our app's folder
|
# cd nodbot-dev # we move into our app's folder
|
||||||
git pull # we pull any changes from git
|
# git pull # we pull any changes from git
|
||||||
npm prune # we remove any unused dependencies
|
# npm prune # we remove any unused dependencies
|
||||||
npm install # we install any missing dependencies
|
# npm install # we install any missing dependencies
|
||||||
pm2 reload nodbot-dev # we reload the app via PM2
|
# pm2 reload nodbot-dev # we reload the app via PM2
|
||||||
|
46
.github/workflows/prod_deploy.yaml
vendored
46
.github/workflows/prod_deploy.yaml
vendored
@ -1,25 +1,25 @@
|
|||||||
name: NodBot Production Deploy
|
# name: NodBot Production Deploy
|
||||||
|
|
||||||
on:
|
# on:
|
||||||
push: # tells github to run this on any push to the dev branch
|
# push: # tells github to run this on any push to the dev branch
|
||||||
branches:
|
# branches:
|
||||||
- main
|
# - main
|
||||||
|
|
||||||
jobs:
|
# jobs:
|
||||||
deploy:
|
# deploy:
|
||||||
runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
if: github.ref == 'refs/heads/main' # we tell Github to only execute this step if we're on our main branch
|
# if: github.ref == 'refs/heads/main' # we tell Github to only execute this step if we're on our main branch
|
||||||
steps:
|
# steps:
|
||||||
- name: Deploying to Probey
|
# - name: Deploying to Probey
|
||||||
uses: appleboy/ssh-action@master # An action made to control Linux servers
|
# uses: appleboy/ssh-action@master # An action made to control Linux servers
|
||||||
with: # We set all our secrets here for the action, these won't be shown in the action logs
|
# with: # We set all our secrets here for the action, these won't be shown in the action logs
|
||||||
host: ${{ secrets.HOST }}
|
# host: ${{ secrets.HOST }}
|
||||||
username: ${{ secrets.USERNAME }}
|
# username: ${{ secrets.USERNAME }}
|
||||||
key: ${{ secrets.KEY }}
|
# key: ${{ secrets.KEY }}
|
||||||
port: ${{ secrets.PORT }}
|
# port: ${{ secrets.PORT }}
|
||||||
script: |
|
# script: |
|
||||||
cd nodbot # we move into our app's folder
|
# cd nodbot # we move into our app's folder
|
||||||
git pull # we pull any changes from git
|
# git pull # we pull any changes from git
|
||||||
npm prune # we remove any unused dependencies
|
# npm prune # we remove any unused dependencies
|
||||||
npm install # we install any missing dependencies
|
# npm install # we install any missing dependencies
|
||||||
pm2 reload nodbot # we reload the app via PM2
|
# pm2 reload nodbot # we reload the app via PM2
|
||||||
|
8
Dockerfile
Normal file
8
Dockerfile
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
FROM node:16
|
||||||
|
RUN mkdir -p /usr/src/app
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
COPY package.json ./
|
||||||
|
RUN npm install
|
||||||
|
COPY . .
|
||||||
|
CMD [ "node", "main.js" ]
|
Loading…
Reference in New Issue
Block a user