mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
chore: updated gh workflow for deploying files to VPS
This commit is contained in:
@@ -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
|
||||||
+1
-10
@@ -39,14 +39,5 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
devOptions: { enabled: true, suppressWarnings: true }
|
devOptions: { enabled: true, suppressWarnings: true }
|
||||||
})
|
})
|
||||||
],
|
]
|
||||||
build: {
|
|
||||||
rollupOptions: {
|
|
||||||
output: {
|
|
||||||
entryFileNames: 'app-[name].js',
|
|
||||||
assetFileNames: 'app-[name].css',
|
|
||||||
chunkFileNames: 'chunk-[name].js'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user