Skip to content

Deploy

Deploy #4

Workflow file for this run

name: Deploy
on:
push:
branches:
- main
paths:
- requirements.txt
- sources/**
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install dependencies
run: |
sudo apt install -y lftp
python -m pip install -U pip
python -m pip install -r requirements.txt
- name: Generate
run: ./build.sh
- name: Automation
run: |
# Prevent "Fatal error: Host key verification failed"
ssh-keyscan -t rsa ${{ secrets.SFTP_URL }} >> ~/.ssh/known_hosts
# Mirror the locally generated website to the production server
lftp \
-e 'mirror --delete --only-missing -en --reverse ./luma ${{ secrets.SFTP_PATH }} ; quit' \
-u '${{ secrets.SFTP_USER }},${{ secrets.SFTP_PASSWORD }}' \
${{ secrets.SFTP_URL }}