Skip to content

Commit

Permalink
feat: add ci vps ovh vuejs 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Leoglme committed Jan 15, 2024
1 parent b7c3daf commit 3b58a83
Showing 1 changed file with 32 additions and 14 deletions.
46 changes: 32 additions & 14 deletions .github/workflows/deploy-app.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,56 @@
name: 🚀 Deploy app to o2switch
name: 🚀 Deploy Vue.js 3 App to VPS

on:
push:
branches: [ 'main' ]
paths:
- 'app/**'
pull_request:
branches: [ 'main' ]
paths:
- 'app/**'
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
env:
APP_DIR: /var/www/aparteasy.dibodev.com

steps:
- name: 🚚 Get latest code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 🚀 Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: 18

- name: 🔍 Install dependencies
run: cd app && npm install
run: cd app && npm install

- name: 🧱 Build application
run: cd app && npm run build

- name: 📂 Sync files
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
- name: 📤 Deploy to VPS
uses: easingthemes/ssh-deploy@main
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
port: 21
protocol: ftp
local-dir: ./app/dist/
server-dir: aparteasy.dibodev.com/
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
ARGS: "-azrut --delete"
SOURCE: "app/dist/"
REMOTE_HOST: ${{ secrets.SSH_HOST }}
REMOTE_USER: ${{ secrets.SSH_USERNAME }}
REMOTE_PORT: ${{ secrets.SSH_PORT }}
TARGET: ${{ env.APP_DIR }}
SCRIPT_BEFORE: |
if ! command -v rsync &> /dev/null
then
echo "rsync could not be found, installing..."
sudo apt-get update
sudo apt-get install -y rsync
else
echo "rsync is already installed."
fi
echo "Starting deployment..."
SCRIPT_AFTER: |
echo "Vue.js app deployed successfully!"

0 comments on commit 3b58a83

Please sign in to comment.