Skip to content

Commit 772c3cf

Browse files
Hari KiranHari Kiran
authored andcommitted
Updated GitHub Actions workflow to deploy only on main
1 parent 126f6fd commit 772c3cf

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/validate.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- "*"
77

8+
push:
9+
branches:
10+
- main # Runs on push to main
11+
812
jobs:
913
validate:
1014
runs-on: ubuntu-latest
@@ -26,3 +30,13 @@ jobs:
2630

2731
- name: Run Security Audit
2832
run: yarn audit --level moderate
33+
34+
- name: Copy files to the server via SFTP
35+
if: github.ref == 'refs/heads/main'
36+
uses: wlixcc/[email protected]
37+
with:
38+
server: ${{ secrets.NEUROJ_SERVER }}
39+
username: ${{ secrets.NEUROJ_SERVER_USER }}
40+
ssh_private_key: ${{ secrets.NEUROJ_SERVER_SSH_KEY }}
41+
local_path: "./*"
42+
remote_path: "/var/www/html/dev/${{ github.actor }}/"

0 commit comments

Comments
 (0)