Trickest CVE Monitor And Deploy #59
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: Trickest CVE Monitor And Deploy | |
on: | |
# schedule: | |
# - cron: "0 * * * *" # 每小时检查一次 | |
workflow_dispatch: | |
jobs: | |
sync_with_upstream: | |
name: Sync with Upstream | |
runs-on: ubuntu-latest | |
if: ${{ github.event.repository.fork }} | |
steps: | |
- name: Checkout target repo | |
uses: actions/checkout@v4 | |
- name: Sync Upstream | |
uses: aormsby/[email protected] | |
with: | |
target_repo_token: ${{ secrets.GITHUB_TOKEN }} | |
upstream_sync_repo: trickest/cve | |
upstream_sync_branch: main | |
target_sync_branch: main | |
test_mode: false | |
# - name: Debug environment | |
# run: | | |
# echo "Working directory: $(pwd)" | |
# echo "Files in the working directory:" | |
# ls -la | |
# # echo "Environment variables:" | |
# # env | |
- name: Check for Failure | |
if: failure() | |
run: | | |
echo "[Error] Due to a change in the workflow file of the upstream repository, GitHub has automatically suspended the scheduled automatic update. You need to manually sync your fork." | |
exit 1 | |
- name: Generate Mkdocs Yaml File | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- run: | | |
python -m pip install --upgrade pip | |
pip install pyyaml | |
python mkdocs_yaml_gen.py | |
# - name: Install rsync | |
# run: | | |
# apt-get update | |
# apt-get install -y rsync | |
- name: Conver Markdown to Site | |
run: | | |
mkdir docs | |
rsync -av --include='[0-9][0-9][0-9][0-9]/' --include='[0-9][0-9][0-9][0-9]/*.md' --exclude='*' --exclude="docs/" --exclude="summary_html/" . docs/ | |
echo '<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=/docs/README.html" /></head></html>' > index.html | |
- name: Deploy docs | |
uses: mhausenblas/mkdocs-deploy-gh-pages@master | |
# Or use mhausenblas/mkdocs-deploy-gh-pages@nomaterial to build without the mkdocs-material theme | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# CUSTOM_DOMAIN: optionaldomain.com | |
CONFIG_FILE: ./mkdocs.yml | |
# EXTRA_PACKAGES: build-base | |
# GITHUB_DOMAIN: github.myenterprise.com | |
# REQUIREMENTS: folder/requirements.txt |