Merge pull request #94 from GoldenretriverYT/patch-2 #62
This file contains 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: Deploy | |
on: | |
push: | |
branches: main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ^3.12.3 | |
cache: pip | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Configure SSH keys | |
run: | | |
mkdir -m 700 ~/.ssh | |
echo "${{ secrets.KEY }}" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
ssh-keyscan -t rsa -p ${{ secrets.PORT }} ${{ secrets.HOST }} > ~/.ssh/known_hosts | |
chmod 600 ~/.ssh/known_hosts | |
- name: Build for production | |
run: mkdocs build -s | |
- name: Sync to production | |
run: rsync -ae "ssh -p ${{ secrets.PORT }}" --zc zstd --zl 19 --delete site/ ${{ secrets.USER }}@${{ secrets.HOST }}:${{ secrets.DEST }} |