ci https://gitee.com/openLuat/LuatOS/commit/8c363372c643cd0a559febb76… #2173
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: update-page | |
on: | |
push: | |
branches: | |
- master | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: publish | |
env: | |
OSS_CONFIG: ${{ secrets.OSS_CONFIG }} | |
OSS_NAME: ${{ secrets.OSS_NAME }} | |
run: | | |
sudo apt update | |
sudo pip3 install setuptools | |
sudo pip3 install -r requirements.txt | |
cd .. | |
sphinx-build -b html luatos-wiki output -E | |
wget http://gosspublic.alicdn.com/ossutil/1.7.1/ossutil64 | |
sudo chmod 755 ossutil64 | |
echo -e "${OSS_CONFIG}" > ~/.ossutilconfig | |
./ossutil64 cp -u -r -j 20 output/ oss://${OSS_NAME}/ | |
cp -r output/ luatos-wiki/ | |
cd luatos-wiki/output/ | |
echo "此文档为离线版,请访问wiki.luatos.com获取最新版本,文档更新时间:$(TZ=UTC-8 date +%Y-%m-%d,%H:%m:%S)" > "请先读我.txt" | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: output | |
path: output | |
- name: trigger en update | |
env: | |
S_GITHUB_TOKEN: ${{ secrets.S_GITHUB_TOKEN }} | |
run: | | |
curl -X POST -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/openLuat/luatos-wiki-en/dispatches -H "Authorization: token $S_GITHUB_TOKEN" -d '{"event_type": "webhook-translate-action"}' | |