Add hotfix and release ci pipelines (#503)
# Description Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. #492, #493 ## Type of change Please delete options that are not relevant. - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update # How Has This Been Tested? Please describe the tests that you ran to verify the changes. Provide instructions so we can reproduce. Please also list any relevant details to your test configuration. # Checklist - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that provide my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules Reviewed-on: #503 Reviewed-by: VylpesTester <tester@vylpes.com> Co-authored-by: Ethan Lane <ethan@vylpes.com> Co-committed-by: Ethan Lane <ethan@vylpes.com>
This commit is contained in:
parent
cdf689f1c5
commit
2ac2737bc0
4 changed files with 146 additions and 1 deletions
71
.forgejo/workflows/hotfix.yml
Normal file
71
.forgejo/workflows/hotfix.yml
Normal file
|
@ -0,0 +1,71 @@
|
|||
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: cp -r . ${{ 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
|
71
.forgejo/workflows/release.yml
Normal file
71
.forgejo/workflows/release.yml
Normal file
|
@ -0,0 +1,71 @@
|
|||
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: cp -r . ${{ 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
|
|
@ -61,6 +61,10 @@ jobs:
|
|||
&& docker compose down \
|
||||
&& (pm2 stop vylbot_stage || true) \
|
||||
&& (pm2 delete vylbot_stage || true) \
|
||||
&& (pm2 stop vylbot_hotfix || true) \
|
||||
&& (pm2 delete vylbot_hotfix || true) \
|
||||
&& (pm2 stop vylbot_release || true) \
|
||||
&& (pm2 delete vylbot_release || true) \
|
||||
&& docker compose up -d \
|
||||
&& sleep 10 \
|
||||
&& yarn db:up \
|
||||
|
|
|
@ -4,7 +4,6 @@ on:
|
|||
push:
|
||||
branches:
|
||||
- feature/*
|
||||
- hotfix/*
|
||||
- renovate/*
|
||||
|
||||
jobs:
|
||||
|
|
Loading…
Reference in a new issue