Update deploy.yml #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Compile and Deploy Jekyll Website | |
| on: | |
| push: | |
| branches: | |
| - deploy | |
| - master | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Ruby Environment | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.2' | |
| bundler-cache: true | |
| - name: Compile Jekyll Artifacts | |
| run: | | |
| bundle install | |
| JEKYLL_ENV=production bundle exec jekyll build | |
| - name: Install lftp | |
| run: sudo apt-get update && sudo apt-get install -y lftp | |
| - name: Deploy | |
| env: | |
| PASSWORD: ${{ secrets.SERVER_PASSWORD }} | |
| HOST: ${{ secrets.SERVER_HOST }} | |
| USERNAME: ${{ secrets.SERVER_USERNAME }} | |
| PORT: ${{ secrets.SERVER_PORT }} | |
| TARGET: ${{ secrets.SERVER_TARGET_PATH }} | |
| run: | | |
| lftp -u $USERNAME,"$PASSWORD" sftp://$HOST:$PORT -e " | |
| set sftp:auto-confirm yes; | |
| mirror -R -v --delete _site/ $TARGET; | |
| quit" |