diff options
| author | Raphael <mail@raphaelkabo.com> | 2024-08-10 16:39:36 +0100 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-10 16:39:36 +0100 | 
| commit | f150caff7e3846ca2ff3d279f966c6e439541235 (patch) | |
| tree | bf694a625b09c57b27948de371a22143014de1d4 | |
| parent | 0e01f8f0e64591e6cdb0d4ea7075ec0da616938c (diff) | |
| parent | f974269014302e32a4c9aa5af746810dc1f40fcb (diff) | |
Merge pull request #167 from lowercasename/rk/deploy-via-docker
Switch to deploy via Docker Compose
| -rw-r--r-- | .github/workflows/deploy.yaml | 16 | ||||
| -rw-r--r-- | .github/workflows/publish-ghcr.yaml | 2 | ||||
| -rwxr-xr-x | deploy.sh | 23 | ||||
| -rw-r--r-- | package.json | 3 | 
4 files changed, 5 insertions, 39 deletions
diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 4a34a2c..9b11022 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -9,14 +9,6 @@ jobs:      deploy:          runs-on: ubuntu-latest          steps: -            - name: Checkout -              uses: actions/checkout@v4 - -            - name: Install pnpm -              uses: pnpm/action-setup@v4 -              with: -                  version: 9 -              - name: Set up known_hosts file                run: |                    mkdir -p ~/.ssh/ && touch ~/.ssh/known_hosts @@ -26,8 +18,6 @@ jobs:                with:                    ssh-private-key: ${{ secrets.SSH_KEY }} -            - name: Install PM2 -              run: pnpm install -g pm2 - -            - name: Deploy -              run: pnpm run deploy +            - name: Run deploy script  +              run: | +                  ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'cd ${{ secrets.DEPLOY_PATH }} && ./deploy.sh' diff --git a/.github/workflows/publish-ghcr.yaml b/.github/workflows/publish-ghcr.yaml index b30dc8e..0b762b2 100644 --- a/.github/workflows/publish-ghcr.yaml +++ b/.github/workflows/publish-ghcr.yaml @@ -1,4 +1,4 @@ -name: Publish to GHCR +name: CI / Publish to GHCR  on:    workflow_dispatch:    push: diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index 9d41e63..0000000 --- a/deploy.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -set -e - -# Set up and redeploy Gathio. Called by `pm2 deploy`. -# Working directory is the root of the repo. - -# PM2 doesn't load the user env, so this gets nvm into the PATH -export NVM_DIR=~/.nvm -source ~/.nvm/nvm.sh -# Set the right Node version -nvm use -# Need to use `development` here else pnpm won't install devDependencies (i.e. tsc) -NODE_ENV=development pnpm install -# This calls `tsc`, which fails due to type errors while we're transitioning -# fully to TypeScript, so we short-circuit it to true to continue running the -# deploy script.  TODO: Remove this short-circuit when we've migrated to -# TypeScript and don't expect any more errors. -pnpm build || true -pm2 reload ecosystem.config.cjs production -pm2 save - -# Build the docs and deploy -mkdocs build -d /var/www/docs.gath.io
\ No newline at end of file diff --git a/package.json b/package.json index 628524f..26d1d00 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,7 @@          "start": "node dist/start.js",          "dev": "nodemon -e ts,js --watch src --exec \"pnpm run build ; pnpm run start\"",          "test:dev": "CYPRESS=true pnpm run dev & wait-on http://localhost:3000 && cypress open --e2e --browser chrome", -        "test": "pnpm run build || true && CYPRESS=true pnpm run start & wait-on http://localhost:3000 && cypress run --e2e --browser chrome", -        "deploy": "pm2 deploy ecosystem.config.cjs production" +        "test": "pnpm run build || true && CYPRESS=true pnpm run start & wait-on http://localhost:3000 && cypress run --e2e --browser chrome"      },      "engines": {          "node": ">=16.16.0"  | 
