Skip to content

Commit

Permalink
enhancement cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
martinyonatann committed Jun 2, 2024
1 parent 03958a3 commit f9350e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/continuous-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ jobs:
- name: Build
run: |
npm run build
ls -la build # Debugging step to list contents of out directory
ls -la .next # Debugging step to list contents of out directory
- name: Test
run: npm test -- --watchAll=false
- name: Adding private SSH key to ssh-agent
env:
Expand All @@ -34,9 +32,16 @@ jobs:
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "
rm -rf /var/www/i-mader.tech/html/*
echo '** old files removed **'
"
scp -o StrictHostKeyChecking=no -r build/* ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/var/www/i-mader.tech/html
ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "
echo "** restarting service tof apply new version **"
ls -la /var/www/i-mader.tech/html # Debugging step to list contents of out directory
pm2 start npm --name "i-mader.tech" -- start
pm2 save
pm2 startup
echo "** service started **"
" || exit 1
5 changes: 1 addition & 4 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,4 @@ jobs:
run: npm install

- name: Build
run: npm run build

- name: Test
run: npm test -- --watchAll=false
run: npm run build

0 comments on commit f9350e2

Please sign in to comment.