Skip to content

Commit

Permalink
Add verbose to rsync logs and create directory for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-basevi committed Aug 16, 2024
1 parent 659b59a commit cc90248
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,29 +107,27 @@ jobs:
- name: Create deployment directory on ${{ matrix.deployment-environment }}
run: |
ssh ${{ secrets.USER }}@${{ secrets.HOST }} -i ${{ steps.ssh.outputs.private-key-path }} /bin/bash <<'EOT'
mkdir -p ${{env.DEPLOYMENT_LOCATION}}
if [ $? -ne 0 ]; then
exit $?
fi
mkdir -p $(dirname ${{env.DEPLOYMENT_LOCATION}})
EOT
- name: Copy to ${{ matrix.deployment-environment }}
run: |
rsync -e 'ssh -i ${{ steps.ssh.outputs.private-key-path }}' \
rsync -v -e 'ssh -i ${{ steps.ssh.outputs.private-key-path }}' \
${{ env.NAME }}-${{ env.VERSION }}.tar.gz \
${{ secrets.USER }}@${{ secrets.HOST_DATA }}:${{ vars.ENVIRONMENT_DIR }}
- name: Deploy to ${{ matrix.deployment-environment }}
run: |
ssh ${{ secrets.USER }}@${{ secrets.HOST }} -i ${{ steps.ssh.outputs.private-key-path }} /bin/bash <<'EOT'
if [ $? -ne 0 ]; then
exit $?
fi
tar -xzf ${{ vars.ENVIRONMENT_DIR }}/${{ env.NAME }}-${{ env.VERSION }}.tar.gz -C ${{ env.DEPLOYMENT_LOCATION }}
source ${{ env.DEPLOYMENT_LOCATION }}/bin/activate
conda-unpack
source ${{ env.DEPLOYMENT_LOCATION }}/bin/deactivate
rm -r ${{ vars.ENVIRONMENT_DIR }}/${{ env.NAME }}-${{ env.VERSION }}.tar.gz
# TODO: Uncomment below line - just keeping environment for debugging
# rm -r ${{ vars.ENVIRONMENT_DIR }}/${{ env.NAME }}-${{ env.VERSION }}.tar.gz
ln -s ${{ vars.MODULE_DIR }}/modules/conda/.common ${{ vars.MODULE_DIR }}/modules/conda/${{ env.NAME }}-${{ env.VERSION }}
EOT
Expand Down

0 comments on commit cc90248

Please sign in to comment.