Skip to content

Commit

Permalink
gha move on
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Apr 10, 2024
1 parent 284faf3 commit 39319c2
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,26 @@ jobs:
- name: Adding Known Hosts
run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts

- name: check if remote file exists
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
if [ -f /var/www/html/${{ steps.package-version.outputs.current-version}} ]; then
exists=yes
else
exists=no
fi
echo "EXISTS=$exists" >> "$GITHUB_OUTPUT"
- name: fail if version exists
if: ${{ steps.version-exists.outputs.EXISTS == 'yes' }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('/var/www/html/${{ steps.package-version.outputs.current-version}} already exists')
# - name: check if remote file exists
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.SSH_HOST }}
# key: ${{ secrets.SSH_PRIVATE_KEY }}git
# port: ${{ secrets.SSH_PORT }}
# script: |
# if [ -f /var/www/html/${{ steps.package-version.outputs.current-version}} ]; then
# exists=yes
# else
# exists=no
# fi
# echo "EXISTS=$exists" >> "$GITHUB_OUTPUT"

# - name: fail if version exists
# if: ${{ steps.version-exists.outputs.EXISTS == 'yes' }}
# uses: actions/github-script@v3
# with:
# script: |
# core.setFailed('/var/www/html/${{ steps.package-version.outputs.current-version}} already exists')

- name: Deploy with rsync
run: rsync -avz ./build/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/var/www/html/${{ steps.package-version.outputs.current-version}}
Expand Down

0 comments on commit 39319c2

Please sign in to comment.