deploy.yaml

This commit is contained in:
lootboxer 2025-07-01 03:54:55 +03:00
parent 25fcbcfe93
commit 2d3a8d930f
2 changed files with 24 additions and 36 deletions

View file

@ -1,9 +1,13 @@
name: CI/CD Pipeline
on:
push:
branches:
- master
jobs:
deploy:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
@ -18,7 +22,23 @@ jobs:
run: npm install
- name: Build
run: 'npm run build-only'
run: npm run build
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build-dist
path: ./dist
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build-dist
path: dist
- name: Deploy to Server
uses: wlixcc/SFTP-Deploy-Action@v1.2.6
@ -26,6 +46,5 @@ jobs:
username: ${{ secrets.FTP_USERNAME }}
server: ${{ secrets.FTP_HOST }}
ssh_private_key: ${{ secrets.DEPLOY_PRIVATE_KEY }}
local_path: './dist/*'
local_path: 'dist/*'
remote_path: ${{ secrets.FTP_PATH }}

View file

@ -1,31 +0,0 @@
on:
push:
branches:
- main
jobs:
deploy:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node 20
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Install Node.js dependencies
run: npm install
- name: Build
run: 'npm run build'
- name: Deploy to Server
uses: wlixcc/SFTP-Deploy-Action@v1.2.6
with:
username: ${{ secrets.FTP_USERNAME }}
server: ${{ secrets.FTP_HOST }}
ssh_private_key: ${{ secrets.DEPLOY_PRIVATE_KEY }}
local_path: './dist/*'
remote_path: ${{ secrets.FTP_PATH }}