Remove SSH keyscan from deploy workflow #4
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 sshpass | |
| run: sudo apt-get update && sudo apt-get install -y sshpass | |
| - name: Deploy via SFTP and Password | |
| env: | |
| PASSWORD: ${{ secrets.SERVER_PASSWORD }} | |
| HOST: ${{ secrets.SERVER_HOST }} | |
| USERNAME: ${{ secrets.SERVER_USERNAME }} | |
| PORT: ${{ secrets.SERVER_PORT }} | |
| TARGET: ${{ secrets.SERVER_TARGET_PATH }} | |
| run: | | |
| cat <<EOF > batch.sftp | |
| lcd _site | |
| cd $TARGET | |
| put -r * | |
| EOF | |
| sshpass -p "$PASSWORD" sftp -P $PORT $USERNAME@$HOST < batch.sftp |