From 200318def7a4498be0aa5b43b74efbbc8e05ec32 Mon Sep 17 00:00:00 2001 From: Spythere Date: Thu, 4 Dec 2025 00:19:16 +0100 Subject: [PATCH] chore: updated gh workflow for deploying files to VPS --- .github/workflows/vps-deploy.yml | 20 ++++++++++++++++++++ vite.config.ts | 11 +---------- 2 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/vps-deploy.yml diff --git a/.github/workflows/vps-deploy.yml b/.github/workflows/vps-deploy.yml new file mode 100644 index 0000000..e0e3cf7 --- /dev/null +++ b/.github/workflows/vps-deploy.yml @@ -0,0 +1,20 @@ +name: Build & Deploy to VPS +'on': + push: + branches: + - master +jobs: + build_and_deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build the app + run: yarn && yarn build + - name: Setup SSH key for connection with the server + run: | + mkdir -p ~/.ssh + echo "${{ secrets.VPS_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa + - name: Send files to the web server and remove old assets + run: | + ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }} -p 2022 "rm -r /var/www/stacjownik/assets" + scp -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa -P 2022 -r ./dist/* ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }}:/var/www/stacjownik \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index c888bfc..0fac1b7 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -39,14 +39,5 @@ export default defineConfig({ }, devOptions: { enabled: true, suppressWarnings: true } }) - ], - build: { - rollupOptions: { - output: { - entryFileNames: 'app-[name].js', - assetFileNames: 'app-[name].css', - chunkFileNames: 'chunk-[name].js' - } - } - } + ] });