1
0
Fork 0
study-area-cn-homepage/.gitea/workflows/build.yaml

63 lines
2.3 KiB
YAML
Raw Normal View History

2024-05-24 21:50:27 +08:00
name: Build and Publish
run-name: Build and Publish homepage (${{ gitea.actor }})
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-24 22:24:00 +08:00
uses: http://git.hmtsai.cn/actions/checkout@v4
- name: Prepare node
2024-05-24 21:57:11 +08:00
run: |
2024-05-24 22:24:00 +08:00
git clone https://git.hmtsai.cn/cxykevin/study-area-home-action-deps
mv study-area-home-action-deps/node-$(uname -m).tar.xz study-area-home-action-deps/node.tar.xz
tar xvJf study-area-home-action-deps/node.tar.xz
2024-05-24 22:44:36 +08:00
mv node-*-linux-* /node
export PATH=/node:$PATH
2024-05-24 22:24:00 +08:00
- name: Check node
2024-05-24 21:57:11 +08:00
run: |
2024-05-24 22:44:36 +08:00
export PATH=/node:$PATH
2024-05-24 22:24:00 +08:00
ls study-area-home-action-deps
2024-05-24 22:26:28 +08:00
echo "------------"
ls .
2024-05-24 22:37:39 +08:00
echo "------------"
2024-05-24 22:44:36 +08:00
node -v
npm -v
2024-05-24 22:32:26 +08:00
- name: Prepare NPM source
run: |
2024-05-24 22:44:36 +08:00
export PATH=/node:$PATH
2024-05-24 22:32:26 +08:00
npm config set registry https://registry.npmmirror.com
- name: npm install
run: |
2024-05-24 22:44:36 +08:00
export PATH=/node:$PATH
2024-05-24 22:32:26 +08:00
npm install
- name: Build
run: |
2024-05-24 22:44:36 +08:00
export PATH=/node:$PATH
2024-05-24 22:32:26 +08:00
npm run build
2024-05-24 21:50:27 +08:00
# - name: Add permission
# run: chmod +x study-area-action-deps/mdbook-linux-$(uname -m)
# - name: Build mdbook
# 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"