fix: replace dibodev.com with dibodev.fr #112
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.fr | |
| steps: | |
| - name: 🚚 Get latest code | |
| uses: actions/checkout@v4 | |
| - name: 🚀 Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: 🔍 Install dependencies | |
| run: cd app && npm install | |
| - name: 📝 Setup Production .env File | |
| run: cd app && cp .env.example .env | |
| - name: 🧱 Build application | |
| run: | | |
| cd app | |
| npm run build | |
| cp .env dist/.env | |
| - name: 📤 Deploy to VPS | |
| uses: easingthemes/ssh-deploy@main | |
| with: | |
| 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 }}/html | |
| 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!" |