From e63ff2890274486d6cc49bc33d122d6e39977965 Mon Sep 17 00:00:00 2001 From: Pedro Delgado Date: Mon, 6 May 2024 19:18:24 +0000 Subject: [PATCH] Deploy action --- .github/workflows/deploy.yml | 39 ++++++++++++++++++++++++++++++++++++ package.json | 5 +++-- 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..95d98cb --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,39 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Node.js CI + +on: + push: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x, 16.x, 18.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run build + + - name: Copy result in server + uses: easingthemes/ssh-deploy@main + with: + SSH_PRIVATE_KEY: ${{ secrets.OCEBOT_PRIVATE_SSH_KEY }} + ARGS: "-rlgoDzvc -i --delete" + SOURCE: "dist/" + REMOTE_HOST: ${{ secrets.OCEBOT_HOST }} + REMOTE_USER: ${{ secrets.OCEBOT_HOST_USER }} + TARGET: ${{ secrets.KT_HOST_PATH }} + EXCLUDE: "" diff --git a/package.json b/package.json index a599219..982316f 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,11 @@ "type": "module", "scripts": { "dev": "vite", - "build": "vite build", + "build": "npm run tw-build && vite build", "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview", - "tw": "npx tailwindcss -i ./src/input.css -o ./src/output.css --watch" + "tw-watch": "npx tailwindcss -i ./src/input.css -o ./src/output.css --watch", + "tw-build" : "npx tailwindcss -i ./src/input.css -o ./src/output.css --minify" }, "dependencies": { "lightweight-charts": "^4.0.1",