forked from study-area-cn/study-area-cn.old
更新 .gitea/workflows/build.yaml
This commit is contained in:
parent
04af20f989
commit
47606aa822
|
@ -78,7 +78,7 @@ jobs:
|
||||||
git remote set-url origin https://${{ secrets.GIT_USER }}:${{ secrets.GIT_PASSWD }}@git.hmtsai.cn/study-area-cn/study-area-cn
|
git remote set-url origin https://${{ secrets.GIT_USER }}:${{ secrets.GIT_PASSWD }}@git.hmtsai.cn/study-area-cn/study-area-cn
|
||||||
git add .
|
git add .
|
||||||
git commit -m "Auto format"
|
git commit -m "Auto format"
|
||||||
echo "__import__(\"os\").system(\"git push\")" > ezpush.py && python3 ezpush.py
|
echo "__import__(\"os\").system(\"sh -c \\\"git push\\\")" > ezpush.py && python3 ezpush.py
|
||||||
Run:
|
Run:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
@ -90,6 +90,7 @@ jobs:
|
||||||
id: src_hash
|
id: src_hash
|
||||||
run: echo "::set-output name=npmhash::$(if [[ $(find src -type f -exec sha256sum {} \; | sha256sum | cut -d ' ' -f 1) = $(cat hash.txt) ]]; then echo run; fi)"
|
run: echo "::set-output name=npmhash::$(if [[ $(find src -type f -exec sha256sum {} \; | sha256sum | cut -d ' ' -f 1) = $(cat hash.txt) ]]; then echo run; fi)"
|
||||||
- name: Prepare Source
|
- name: Prepare Source
|
||||||
|
if: ${{ steps.src_hash.outputs.src_hash != 'run' }}
|
||||||
run: |
|
run: |
|
||||||
echo "--- write source ---"
|
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 main contrib non-free">/etc/apt/sources.list
|
||||||
|
@ -100,9 +101,11 @@ jobs:
|
||||||
echo "--- update source ---"
|
echo "--- update source ---"
|
||||||
apt-get update
|
apt-get update
|
||||||
- name: Prepare Lftp
|
- name: Prepare Lftp
|
||||||
|
if: ${{ steps.src_hash.outputs.src_hash != 'run' }}
|
||||||
run: |
|
run: |
|
||||||
apt-get install lftp -y
|
apt-get install lftp -y
|
||||||
- name: Cache mdbook
|
- name: Cache mdbook
|
||||||
|
if: ${{ steps.src_hash.outputs.src_hash != 'run' }}
|
||||||
uses: https://git.hmtsai.cn/actions/cache@v4
|
uses: https://git.hmtsai.cn/actions/cache@v4
|
||||||
id: cache-mdbook
|
id: cache-mdbook
|
||||||
env:
|
env:
|
||||||
|
@ -112,16 +115,19 @@ jobs:
|
||||||
path: |
|
path: |
|
||||||
study-area-action-deps
|
study-area-action-deps
|
||||||
- name: Get file
|
- name: Get file
|
||||||
if: ${{ steps.cache-mdbook.outputs.cache-hit != 'true' }}
|
if: ${{ steps.src_hash.outputs.src_hash != 'run' && steps.cache-mdbook.outputs.cache-hit != 'true' }}
|
||||||
run: |
|
run: |
|
||||||
git clone https://git.hmtsai.cn/cxykevin/study-area-action-deps
|
git clone https://git.hmtsai.cn/cxykevin/study-area-action-deps
|
||||||
echo "Check..."
|
echo "Check..."
|
||||||
ls study-area-action-deps
|
ls study-area-action-deps
|
||||||
- name: Add permission
|
- name: Add permission
|
||||||
|
if: ${{ steps.src_hash.outputs.src_hash != 'run' }}
|
||||||
run: chmod +x study-area-action-deps/mdbook-linux-$(uname -m)
|
run: chmod +x study-area-action-deps/mdbook-linux-$(uname -m)
|
||||||
- name: Build mdbook
|
- name: Build mdbook
|
||||||
|
if: ${{ steps.src_hash.outputs.src_hash != 'run' }}
|
||||||
run: study-area-action-deps/mdbook-linux-$(uname -m) build
|
run: study-area-action-deps/mdbook-linux-$(uname -m) build
|
||||||
- name: Cache mapbook
|
- name: Cache mapbook
|
||||||
|
if: ${{ steps.src_hash.outputs.src_hash != 'run' }}
|
||||||
uses: https://git.hmtsai.cn/actions/cache@v4
|
uses: https://git.hmtsai.cn/actions/cache@v4
|
||||||
id: cache-mapbook
|
id: cache-mapbook
|
||||||
env:
|
env:
|
||||||
|
@ -131,17 +137,20 @@ jobs:
|
||||||
path: |
|
path: |
|
||||||
mapbook
|
mapbook
|
||||||
- name: Get mapbook
|
- name: Get mapbook
|
||||||
if: ${{ steps.cache-mapbook.outputs.cache-hit != 'true' }}
|
if: ${{ steps.src_hash.outputs.src_hash != 'run' && steps.cache-mapbook.outputs.cache-hit != 'true' }}
|
||||||
run: |
|
run: |
|
||||||
git clone https://git.hmtsai.cn/cxykevin/mapbook
|
git clone https://git.hmtsai.cn/cxykevin/mapbook
|
||||||
echo "Check..."
|
echo "Check..."
|
||||||
ls mapbook
|
ls mapbook
|
||||||
- name: Build sitemap
|
- name: Build sitemap
|
||||||
|
if: ${{ steps.src_hash.outputs.src_hash != 'run' }}
|
||||||
run: |
|
run: |
|
||||||
python3 mapbook/build.py
|
python3 mapbook/build.py
|
||||||
- name: Check book
|
- name: Check book
|
||||||
|
if: ${{ steps.src_hash.outputs.src_hash != 'run' }}
|
||||||
run: ls book
|
run: ls book
|
||||||
- name: Upload
|
- name: Upload
|
||||||
|
if: ${{ steps.src_hash.outputs.src_hash != 'run' }}
|
||||||
run: |
|
run: |
|
||||||
mv book index
|
mv book index
|
||||||
lftp ${{ secrets.FTP_SITE }} -u ${{ secrets.FTP_USERNAME }},${{ secrets.FTP_PWD }} -e "mirror -R index index"
|
lftp ${{ secrets.FTP_SITE }} -u ${{ secrets.FTP_USERNAME }},${{ secrets.FTP_PWD }} -e "mirror -R index index"
|
||||||
|
|
Loading…
Reference in New Issue