Skip to content

Commit

Permalink
cleanup webroot before copying files
Browse files Browse the repository at this point in the history
  • Loading branch information
rantanevich committed Mar 15, 2024
1 parent 43af90c commit fdda926
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions .github/actions/deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ inputs:
webroot:
description: The root directory of the web server that will be used to search for a file
required: true
temproot:
description: The temproot directory of the web server that will be used to search for a file
required: true
serv:
systemd_service:
description: Systemd service name
required: true
ssh_hostname:
Expand Down Expand Up @@ -64,24 +61,19 @@ runs:
- name: Build project
working-directory: ui
shell: sh
run: |
pnpm run build
rm -rf node_modules
run: pnpm run build

- name: Deploy compiled project to the remote server
shell: sh
run: |
sshpass -p "${{ inputs.ssh_password }}" \
rsync \
--archive \
--verbose \
--human-readable \
--delete-before \
${{ inputs.keep_source_maps == 'false' && '--exclude="*.map"' || '' }} ui/ ${{ inputs.ssh_username }}@${{ inputs.ssh_hostname }}:${{ inputs.webroot }}/
ssh ${{ inputs.ssh_username }}@${{ inputs.ssh_hostname }} rm -rf ${{ inputs.webroot }}
sshpass -p "${{ inputs.ssh_password }}" \
ssh ${{ inputs.ssh_username }}@${{ inputs.ssh_hostname }} "sudo systemctl restart ${{ inputs.serv }}"
scp -r ui/ ${{ inputs.ssh_username }}@${{ inputs.ssh_hostname }}:${{ inputs.webroot }}/
sshpass -p "${{ inputs.ssh_password }}" \
ssh ${{ inputs.ssh_username }}@${{ inputs.ssh_hostname }} "sudo systemctl restart ${{ inputs.systemd_service }}"
# - name: Copy Files to Server
# shell: sh
Expand Down

0 comments on commit fdda926

Please sign in to comment.