Skip to content

Commit

Permalink
change of github action to support sftp
Browse files Browse the repository at this point in the history
  • Loading branch information
KubloPL committed May 28, 2024
1 parent e955410 commit 335a563
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 13 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Build site
name: Build and Deploy Site

on:
push:
# branches:
# - develop
branches:
- main

jobs:
build-and-deploy:
Expand All @@ -16,21 +16,20 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 21
node-version: 14

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Deploy to FTPS
uses: SamKirkland/[email protected]
- name: Deploy to SFTP
uses: appleboy/sftp-action@master
with:
server: ${{ secrets.FTPS_SERVER }}
username: ${{ secrets.FTPS_USERNAME }}
password: ${{ secrets.FTPS_PASSWORD }}
server-dir: /srv/dev-disk-by-uuid-f4fc2a45-bf9e-4201-8897-946abbcea427/Users/iteam/site_files/
protocol: ftps
port: 21

host: ${{ secrets.SFTP_HOST }}
username: ${{ secrets.SFTP_USERNAME }}
password: ${{ secrets.SFTP_PASSWORD }}
port: ${{ secrets.SFTP_PORT }}
local: "dist"
remote: "/home/demoman/github-actions/" # Path on the SFTP server where files will be uploaded
36 changes: 36 additions & 0 deletions .github/workflows/deploy_old_ftps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build site

on:
push:
# branches:
# - develop

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 21

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Deploy to FTPS
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.FTPS_SERVER }}
username: ${{ secrets.FTPS_USERNAME }}
password: ${{ secrets.FTPS_PASSWORD }}
server-dir: /srv/dev-disk-by-uuid-f4fc2a45-bf9e-4201-8897-946abbcea427/Users/iteam/site_files/
protocol: ftps
port: 21

0 comments on commit 335a563

Please sign in to comment.