Use just stage.yml
This commit is contained in:
parent
d3a0c418be
commit
ccac9861a9
3 changed files with 3 additions and 143 deletions
|
@ -1,71 +0,0 @@
|
||||||
name: Deploy Hotfix To Stage
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- hotfix/*
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
environment: prod
|
|
||||||
|
|
||||||
runs-on: node
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Use Node.js
|
|
||||||
uses: actions/setup-node@v1
|
|
||||||
with:
|
|
||||||
node-version: 18.x
|
|
||||||
- run: yarn install --frozen-lockfile
|
|
||||||
- run: yarn build
|
|
||||||
- run: yarn test
|
|
||||||
|
|
||||||
- name: "Copy files over to location"
|
|
||||||
run: rsync -rvzP . ${{ secrets.HOTFIX_REPO_PATH }}
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
environment: prod
|
|
||||||
needs: build
|
|
||||||
runs-on: node
|
|
||||||
steps:
|
|
||||||
- uses: https://github.com/appleboy/ssh-action@v1.0.0
|
|
||||||
env:
|
|
||||||
DB_NAME: ${{ secrets.HOTFIX_DB_NAME }}
|
|
||||||
DB_AUTH_USER: ${{ secrets.HOTFIX_DB_AUTH_USER }}
|
|
||||||
DB_AUTH_PASS: ${{ secrets.HOTFIX_DB_AUTH_PASS }}
|
|
||||||
DB_HOST: ${{ secrets.HOTFIX_DB_HOST }}
|
|
||||||
DB_PORT: ${{ secrets.HOTFIX_DB_PORT }}
|
|
||||||
DB_ROOT_HOST: ${{ secrets.HOTFIX_DB_ROOT_HOST }}
|
|
||||||
DB_SYNC: ${{ secrets.HOTFIX_DB_SYNC }}
|
|
||||||
DB_LOGGING: ${{ secrets.HOTFIX_DB_LOGGING }}
|
|
||||||
DB_DATA_LOCATION: ${{ secrets.HOTFIX_DB_DATA_LOCATION }}
|
|
||||||
SERVER_PATH: ${{ secrets.HOTFIX_SSH_SERVER_PATH }}
|
|
||||||
BOT_TOKEN: ${{ secrets.HOTFIX_BOT_TOKEN }}
|
|
||||||
BOT_VER: ${{ vars.HOTFIX_BOT_VER }}
|
|
||||||
BOT_AUTHOR: ${{ vars.HOTFIX_BOT_AUTHOR }}
|
|
||||||
BOT_OWNERID: ${{ vars.HOTFIX_BOT_OWNERID }}
|
|
||||||
BOT_CLIENTID: ${{ vars.HOTFIX_BOT_CLIENTID }}
|
|
||||||
ABOUT_FUNDING: ${{ vars.HOTFIX_ABOUT_FUNDING }}
|
|
||||||
ABOUT_REPO: ${{ vars.HOTFIX_ABOUT_REPO }}
|
|
||||||
CACHE_INTERVAL: ${{ vars.HOTFIX_CACHE_INTERVAL }}
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.HOTFIX_SSH_HOST }}
|
|
||||||
username: ${{ secrets.HOTFIX_SSH_USER }}
|
|
||||||
key: ${{ secrets.HOTFIX_SSH_KEY }}
|
|
||||||
port: ${{ secrets.HOTFIX_SSH_PORT }}
|
|
||||||
envs: DB_NAME,DB_AUTH_USER,DB_AUTH_PASS,DB_HOST,DB_PORT,DB_ROOT_HOST,DB_SYNC,DB_LOGGING,DB_DATA_LOCATION,BOT_TOKEN,BOT_VER,BOT_AUTHOR,BOT_OWNERID,BOT_CLIENTID,ABOUT_FUNDING,ABOUT_REPO,CACHE_INTERVAL
|
|
||||||
script: |
|
|
||||||
source .sshrc \
|
|
||||||
&& cd /home/vylpes/apps/vylbot/vylbot_hotfix \
|
|
||||||
&& docker compose down \
|
|
||||||
&& (pm2 stop vylbot_hotfix || true) \
|
|
||||||
&& (pm2 delete vylbot_hotfix || true) \
|
|
||||||
&& (pm2 stop vylbot_stage || true) \
|
|
||||||
&& (pm2 delete vylbot_stage || true) \
|
|
||||||
&& (pm2 stop vylbot_release || true) \
|
|
||||||
&& (pm2 delete vylbot_release || true) \
|
|
||||||
&& docker compose up -d \
|
|
||||||
&& sleep 10 \
|
|
||||||
&& yarn db:up \
|
|
||||||
&& pm2 start --name vylbot_hotfix dist/vylbot.js
|
|
|
@ -1,71 +0,0 @@
|
||||||
name: Deploy Release To Stage
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- release/*
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
environment: prod
|
|
||||||
|
|
||||||
runs-on: node
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Use Node.js
|
|
||||||
uses: actions/setup-node@v1
|
|
||||||
with:
|
|
||||||
node-version: 18.x
|
|
||||||
- run: yarn install --frozen-lockfile
|
|
||||||
- run: yarn build
|
|
||||||
- run: yarn test
|
|
||||||
|
|
||||||
- name: "Copy files over to location"
|
|
||||||
run: rsync -rvzP . ${{ secrets.RELEASE_REPO_PATH }}
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
environment: prod
|
|
||||||
needs: build
|
|
||||||
runs-on: node
|
|
||||||
steps:
|
|
||||||
- uses: https://github.com/appleboy/ssh-action@v1.0.0
|
|
||||||
env:
|
|
||||||
DB_NAME: ${{ secrets.RELEASE_DB_NAME }}
|
|
||||||
DB_AUTH_USER: ${{ secrets.RELEASE_DB_AUTH_USER }}
|
|
||||||
DB_AUTH_PASS: ${{ secrets.RELEASE_DB_AUTH_PASS }}
|
|
||||||
DB_HOST: ${{ secrets.RELEASE_DB_HOST }}
|
|
||||||
DB_PORT: ${{ secrets.RELEASE_DB_PORT }}
|
|
||||||
DB_ROOT_HOST: ${{ secrets.RELEASE_DB_ROOT_HOST }}
|
|
||||||
DB_SYNC: ${{ secrets.RELEASE_DB_SYNC }}
|
|
||||||
DB_LOGGING: ${{ secrets.RELEASE_DB_LOGGING }}
|
|
||||||
DB_DATA_LOCATION: ${{ secrets.RELEASE_DB_DATA_LOCATION }}
|
|
||||||
SERVER_PATH: ${{ secrets.RELEASE_SSH_SERVER_PATH }}
|
|
||||||
BOT_TOKEN: ${{ secrets.RELEASE_BOT_TOKEN }}
|
|
||||||
BOT_VER: ${{ vars.RELEASE_BOT_VER }}
|
|
||||||
BOT_AUTHOR: ${{ vars.RELEASE_BOT_AUTHOR }}
|
|
||||||
BOT_OWNERID: ${{ vars.RELEASE_BOT_OWNERID }}
|
|
||||||
BOT_CLIENTID: ${{ vars.RELEASE_BOT_CLIENTID }}
|
|
||||||
ABOUT_FUNDING: ${{ vars.RELEASE_ABOUT_FUNDING }}
|
|
||||||
ABOUT_REPO: ${{ vars.RELEASE_ABOUT_REPO }}
|
|
||||||
CACHE_INTERVAL: ${{ vars.RELEASE_CACHE_INTERVAL }}
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.RELEASE_SSH_HOST }}
|
|
||||||
username: ${{ secrets.RELEASE_SSH_USER }}
|
|
||||||
key: ${{ secrets.RELEASE_SSH_KEY }}
|
|
||||||
port: ${{ secrets.RELEASE_SSH_PORT }}
|
|
||||||
envs: DB_NAME,DB_AUTH_USER,DB_AUTH_PASS,DB_HOST,DB_PORT,DB_ROOT_HOST,DB_SYNC,DB_LOGGING,DB_DATA_LOCATION,BOT_TOKEN,BOT_VER,BOT_AUTHOR,BOT_OWNERID,BOT_CLIENTID,ABOUT_FUNDING,ABOUT_REPO,CACHE_INTERVAL
|
|
||||||
script: |
|
|
||||||
source .sshrc \
|
|
||||||
&& cd /home/vylpes/apps/vylbot/vylbot_release \
|
|
||||||
&& docker compose down \
|
|
||||||
&& (pm2 stop vylbot_release || true) \
|
|
||||||
&& (pm2 delete vylbot_release || true) \
|
|
||||||
&& (pm2 stop vylbot_hotfix || true) \
|
|
||||||
&& (pm2 delete vylbot_hotfix || true) \
|
|
||||||
&& (pm2 stop vylbot_stage || true) \
|
|
||||||
&& (pm2 delete vylbot_stage || true) \
|
|
||||||
&& docker compose up -d \
|
|
||||||
&& sleep 10 \
|
|
||||||
&& yarn db:up \
|
|
||||||
&& pm2 start --name vylbot_release dist/vylbot.js
|
|
|
@ -4,6 +4,8 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- develop
|
- develop
|
||||||
|
- hotfix/*
|
||||||
|
- release/*
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -42,7 +44,7 @@ jobs:
|
||||||
DB_DATA_LOCATION: ${{ secrets.STAGE_DB_DATA_LOCATION }}
|
DB_DATA_LOCATION: ${{ secrets.STAGE_DB_DATA_LOCATION }}
|
||||||
SERVER_PATH: ${{ secrets.STAGE_SSH_SERVER_PATH }}
|
SERVER_PATH: ${{ secrets.STAGE_SSH_SERVER_PATH }}
|
||||||
BOT_TOKEN: ${{ secrets.STAGE_BOT_TOKEN }}
|
BOT_TOKEN: ${{ secrets.STAGE_BOT_TOKEN }}
|
||||||
BOT_VER: ${{ vars.STAGE_BOT_VER }}
|
BOT_VER: ${{ vars.STAGE_BOT_VER }}-${{ github.ref_name }}
|
||||||
BOT_AUTHOR: ${{ vars.STAGE_BOT_AUTHOR }}
|
BOT_AUTHOR: ${{ vars.STAGE_BOT_AUTHOR }}
|
||||||
BOT_OWNERID: ${{ vars.STAGE_BOT_OWNERID }}
|
BOT_OWNERID: ${{ vars.STAGE_BOT_OWNERID }}
|
||||||
BOT_CLIENTID: ${{ vars.STAGE_BOT_CLIENTID }}
|
BOT_CLIENTID: ${{ vars.STAGE_BOT_CLIENTID }}
|
||||||
|
|
Loading…
Reference in a new issue