deploy.yaml
This commit is contained in:
parent
25fcbcfe93
commit
2d3a8d930f
2 changed files with 24 additions and 36 deletions
|
|
@ -1,9 +1,13 @@
|
||||||
on:
|
name: CI/CD Pipeline
|
||||||
|
|
||||||
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
@ -18,7 +22,23 @@ jobs:
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|
||||||
- name: Build
|
- 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
|
- name: Deploy to Server
|
||||||
uses: wlixcc/SFTP-Deploy-Action@v1.2.6
|
uses: wlixcc/SFTP-Deploy-Action@v1.2.6
|
||||||
|
|
@ -26,6 +46,5 @@ jobs:
|
||||||
username: ${{ secrets.FTP_USERNAME }}
|
username: ${{ secrets.FTP_USERNAME }}
|
||||||
server: ${{ secrets.FTP_HOST }}
|
server: ${{ secrets.FTP_HOST }}
|
||||||
ssh_private_key: ${{ secrets.DEPLOY_PRIVATE_KEY }}
|
ssh_private_key: ${{ secrets.DEPLOY_PRIVATE_KEY }}
|
||||||
local_path: './dist/*'
|
local_path: 'dist/*'
|
||||||
remote_path: ${{ secrets.FTP_PATH }}
|
remote_path: ${{ secrets.FTP_PATH }}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 }}
|
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue