Skip to content

Fix image loading + Added guiding info #50

Fix image loading + Added guiding info

Fix image loading + Added guiding info #50

Workflow file for this run

name: CI
on:
push:
branches: ['main']
pull_request:
branches: ['main']
jobs:
lint:
name: 'Lint code'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install pnpm
run: npm install -g pnpm
- name: Cache node_modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Copy env
run: cp .env.example .env
- name: Build
run: pnpm run build
- name: Check lint
run: pnpm run lint
- name: TypeScript check
run: pnpm run check
deploy:
name: Deploy
needs: lint
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Copy env file
run: cp /opt/apps/Web/.env ./.env
- name: Install & Build
run: |
npm install -g pnpm
pnpm install --frozen-lockfile
pnpm run build
- name: Sync Files
run: |
rsync -av --delete ./ /opt/apps/Web/ \
--exclude .git \
--exclude node_modules \
--exclude .env \
--exclude "uploads/" \
--exclude "logs/" \
--exclude ".cache/"
- name: Restart Application
run: |
cd /opt/apps/Web
pnpm install
pnpm run migrate
sudo systemctl restart web