Skip to content

Commit

Permalink
chore: rename actions yml file and prepare pm2 run more closely
Browse files Browse the repository at this point in the history
  • Loading branch information
sparky-raccoon committed Jan 14, 2024
1 parent 1d3133c commit 0c02456
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Epitome CI/CD
on:
push:
branches:
- master
- test/gh-actions
jobs:
deploy:
name: Deploy to Raspberry Pi 4 (self-hosted) 🦖
runs-on: self-hosted
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install npm dependencies with yarn
run: yarn
- name: Build epitome (/dist)
run: yarn run build
- name: Stop previous epitome pm2 process
run: yarn run stop-and-delete
- name: Prepare application directory
run: rm -rf ~/apps/epitome && mkdir ~/apps/epitome
- name: Move build contents to application directory
run: mv dist/* ~/apps/epitome
- name: Start new epitome pm2 process
run: cd ~/apps/epitome && yarn run start-and-register
17 changes: 0 additions & 17 deletions .github/workflows/raspberry-pi-deployment.yml

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"build": "rm -rf dist && tsc -p tsconfig.prod.json && tsc-alias",
"start-and-register": "pm2 start -f dist/index.js --name epitome && pm2 save",
"stop-and-delete": "pm2 delete epitome 2> /dev/null || true",
"build-and-run": "yarn run build && yarn run stop-and-delete && yarn run start-and-register",
"deploy-commands": "tsx src/deploy-commands.ts",
"deploy-commands-dev": "export NODE_ENV=development && tsx src/deploy-commands.ts",
"prepare": "husky install"
Expand Down

0 comments on commit 0c02456

Please sign in to comment.