Skip to content

Commit

Permalink
Semi-atomic deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Daanvm committed Oct 12, 2024
1 parent a327a34 commit 105def5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,16 @@ jobs:
env:
SSHPASS: ${{ secrets.STRATO_SSH_PASSWORD }}
run: |
sshpass -e scp -oStrictHostKeyChecking=no ./build.tar.gz ${{ secrets.STRATO_SSH_USERNAME }}@ssh.strato.com/new-release.tar.gz
sshpass -e ssh -oStrictHostKeyChecking=no ${{ secrets.STRATO_SSH_USERNAME }}@ssh.strato.com ls -lah
sshpass -e scp -oStrictHostKeyChecking=no ./build.tar.gz ${{ secrets.STRATO_SSH_USERNAME }}@ssh.strato.com/build.tar.gz
sshpass -e ssh -oStrictHostKeyChecking=no ${{ secrets.STRATO_SSH_USERNAME }}@ssh.strato.com << EOF
rm -rf ./new-release
mkdir new-release
cd new-release
tar -xzvf ./build.tar.gz
cd ..
rm -rf ./prev-release
mv ./public ./prev-release
mv ./new-release/html ./public
rm -rf ./new-release
EOF
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN /var/www/html/scripts/christelmusic warmup

FROM builder as zipper

RUN cd /var/www/ && tar -czvf /build.tar.gz html
RUN cd /var/www/html && tar -czvf /build.tar.gz .

FROM base

Expand Down

0 comments on commit 105def5

Please sign in to comment.