Skip to content

Update Prettier configuration and modify CI/CD workflow to use npm #56

Update Prettier configuration and modify CI/CD workflow to use npm

Update Prettier configuration and modify CI/CD workflow to use npm #56

Workflow file for this run

name: CI/CD
on:
push:
branches: [master]
jobs:
lint:
runs-on: ubuntu-latest
name: Run Prettier and ESLint
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js environment
uses: actions/setup-node@v3
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm install
- name: Run Prettier and ESLint
run: |
npm run format:check
npm run lint
build-and-deploy:
needs: lint
runs-on: ubuntu-latest
name: Build and Deploy
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js environment
uses: actions/setup-node@v3
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Copying files to server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
port: ${{ secrets.REMOTE_PORT }}
key: ${{ secrets.SSH_KEY }}
rm: true
strip_components: 1
source: "dist/*"
target: ${{ secrets.REMOTE_DIR }}