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 86dedab
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
name: Build website .tar.gz
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Build .tar.gz file
run: |
Expand Down 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 86dedab

Please sign in to comment.