chore: configured staging workflow

This commit is contained in:
nostrdev-com 2025-03-24 16:36:59 +03:00
parent 319bbcf257
commit ec58af2976
3 changed files with 7404 additions and 1 deletions

@ -0,0 +1,42 @@
name: Release to Staging
on:
push:
branches:
- staging
jobs:
build_and_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 20
- name: Audit
run: npm audit --omit=dev
- name: Install Dependencies
run: npm ci
- name: Formatter check
run: npm run formatter:check
- name: Create .env File
run: echo "PORT=${{ vars.STAGING_PORT }}" > .env
- name: Create Build
run: npm run build
- name: Setup SSH
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.SSH_STAGING_PRIVATE_KEY }}
- name: Release Build
run: |
ssh -o StrictHostKeyChecking=no api@51.161.134.20 'source ~/.nvm/nvm.sh; cd cs-backend && echo "PORT=${{ vars.PORT }}" > .env && git pull && npm ci && npm run build && pm2 delete cellar-api && pm2 start npm --name cellar-api -- start'

7354
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -8,7 +8,8 @@
"dev": "nodemon src/index.ts",
"test": "echo \"Error: no test specified\" && exit 1",
"formatter:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"",
"formatter:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\""
"formatter:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"",
"release": "commit-and-tag-version"
},
"repository": {
"type": "git",
@ -22,6 +23,12 @@
"express": "^4.21.2"
},
"devDependencies": {
"@saithodev/semantic-release-gitea": "^2.1.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^13.0.1",
"@semantic-release/git": "^10.0.1",
"@semantic-release/npm": "^12.0.1",
"@semantic-release/release-notes-generator": "^14.0.3",
"@types/express": "^5.0.1",
"@types/node": "^22.13.12",
"concurrently": "^9.1.2",