diff --git a/.github/workflows/deploy-strato.yaml b/.github/workflows/deploy-strato.yaml index e64ea55..514855d 100644 --- a/.github/workflows/deploy-strato.yaml +++ b/.github/workflows/deploy-strato.yaml @@ -9,8 +9,7 @@ jobs: name: Build website zip runs-on: ubuntu-latest steps: - - name: Checkout master - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - name: Build .tar.gz file run: | @@ -18,10 +17,33 @@ jobs: docker create --name zipper local-img/zipper docker cp zipper:/build.tar.gz ./build.tar.gz docker rm -f zipper + shell: bash + + - uses: actions/upload-artifact@v4 + with: + name: build-tar-gz + path: ./build.tar.gz - # TODO: remove debug - - name: Debug print all files - run: find ${GITHUB_WORKSPACE} + deploy: + name: Deploy website to Strato + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + name: build-tar-gz + + - name: Extract .tar.gz file + run: | + tar -xzvf build.tar.gz + rm build.tar.gz shell: bash - # TODO: upload to sftp + - name: Upload to Strato + # FROM: https://github.com/Atyn/simple-sftp-action/blob/main/action.yml + run: | + echo " + $(find . -type d | sed -e 's/^/mkdir /;') + mput -r . + exit + " > /tmp/commands.sftp + sftp "sftp://${{ secrets.STRATO_USERNAME }}:${{ secrets.STRATO_PASSWORD }}@ssh.strato.com:22/" < /tmp/commands.ftp diff --git a/Dockerfile b/Dockerfile index 66db7c1..6d74db2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN /var/www/html/scripts/christelmusic warmup FROM builder as zipper -RUN tar -czvf /build.tar.gz /var/www/html/* +RUN tar -czvf /build.tar.gz /var/www/html/* --exclude-vcs-ignores FROM base