Skip to content

Commit

Permalink
Ci (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrinkl authored Nov 20, 2024
1 parent f3ad67d commit 4206df1
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI

on:
push:
branches:
- main
workflow_dispatch:

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install dependencies
run: npm install

- name: Run linting and typechecking
run: npm run check

- name: Run tests
run: npm test

- name: Build project
run: npm run build

- name: Upload dist to remote server
uses: appleboy/scp-action@v0.1.2
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
password: ${{ secrets.REMOTE_PASSWORD }}
target: ./dist
source: ./dist/*
rm: true
strip_components: 1

- name: Execute remote commands
uses: appleboy/ssh-action@v0.1.2
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
password: ${{ secrets.REMOTE_PASSWORD }}
script: |
pm2 restart artifacts
File renamed without changes.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"postbuild": "rm -rf ./dist && cp -r packages/server/dist/ ./dist && cp -r packages/client/dist ./dist/static && cp -r packages/server/migrations ./dist/migrations",
"lint": "eslint .",
"typecheck": "npm run typecheck --workspaces",
"check": "npm run lint && npm run typecheck"
"check": "npm run lint && npm run typecheck",
"test": "echo no tests"
},
"devDependencies": {
"@eslint/js": "^9.15.0",
Expand Down

0 comments on commit 4206df1

Please sign in to comment.