study-area-cn/.gitea/workflows/build.yaml

40 lines
1.6 KiB
YAML
Raw Normal View History

2024-05-16 21:19:30 +08:00
name: Build and Publish
run-name: Build and Publish book (${{ gitea.actor }})
2024-05-18 12:52:31 +08:00
on: [push]
jobs:
Run:
runs-on: ubuntu-latest
steps:
- name: Info
run: echo "OS=${{ runner.os }} NAME=${{ gitea.event_name }} REPO=${{ gitea.repository }} BRANCH=${{ gitea.ref }} ST=${{ job.status }} RUNID=${{ gitea.run_id }}"
- name: Prepare Source
run: |
echo "--- write source ---"
echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free">/etc/apt/sources.list
echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free">>/etc/apt/sources.list
echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free">>/etc/apt/sources.list
cat /etc/apt/sources.list
rm -rf /etc/apt/sources.list.d/*
echo "--- update source ---"
apt-get update
- name: Prepare Lftp
run: |
apt-get install lftp -y
- name: Checkout
2024-05-23 11:58:01 +08:00
uses: https://git.hmtsai.cn/actions/checkout@v4
- name: Get file
run: |
2024-05-23 11:58:01 +08:00
git clone https://git.hmtsai.cn/cxykevin/study-area-action-deps
echo "Check..."
ls study-area-action-deps
- name: Add permission
2024-05-19 09:54:14 +08:00
run: chmod +x study-area-action-deps/mdbook-linux-$(uname -m)
- name: Build mdbook
2024-05-19 09:53:25 +08:00
run: study-area-action-deps/mdbook-linux-$(uname -m) build
- name: Check book
run: ls book
- name: Upload
run: lftp ${{ secrets.FTP_SITE }} -u ${{ secrets.FTP_USERNAME }},${{ secrets.FTP_PWD }} -e "mirror -R book book"