百度站长URL提交 #387
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: 百度站长URL提交 | |
on: | |
# push: | |
# branches: | |
# - master | |
# 每天定时索引 | |
# workflow_dispatch: | |
# 定时提交百度url 每两天执行一次 | |
# https://crontab.guru/ | |
schedule: | |
- cron: '0 0 1/2 * *' | |
workflow_dispatch: | |
jobs: | |
bot: | |
runs-on: ubuntu-latest | |
steps: | |
# 遍历sitemap文件中的url | |
- id: sitemaps | |
name: Fetch Sitemap Files | |
run: | | |
echo "urls<<EOF" >> $GITHUB_ENV | |
for line in $(curl -s https://www.xiehai.zone/sitemap_index.xml | grep -oP "(?<=<loc>)[^<]+") | |
do | |
echo "$(curl -s ${line} | grep -oP "(?<=<loc>)[^<]+")" >> $GITHUB_ENV | |
done | |
echo "EOF" >> $GITHUB_ENV | |
# 百度url提交 | |
- name: Submit Baidu Urls | |
run: > | |
curl -X POST -s -d '${{ env.urls }}' | |
'http://data.zz.baidu.com/urls?site=https://www.xiehai.zone&token=${{ secrets.BAIDU_KEY }}' |