-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (40 loc) · 1.09 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# yamllint disable rule:line-length
name: Deploy
on:
push:
branches:
- main
paths:
- requirements.txt
- sources/**
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- 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: Setup SSH
# Prevent "Fatal error: Host key verification failed"
run: |
mkdir -p ~/.ssh
ssh-keyscan -H ${{ secrets.SFTP_URL }} >> ~/.ssh/known_hosts
- name: Mirror
run: |
lftp \
-e 'mirror --delete --transfer-all --reverse --verbose=1 ./luma ${{ secrets.SFTP_PATH }} ; quit' \
-u '${{ secrets.SFTP_USER }},${{ secrets.SFTP_PASSWORD }}' \
sftp://${{ secrets.SFTP_URL }}