Git Product home page Git Product logo

baidu-submit-github-action's Introduction

baidu-submit-github-action

使用 API 提交方式向百度搜索主动推送 URL 的 GitHub Actions 模版

使用方法

  1. Fork 这个项目

  2. 添加一个叫 BAIDU_TOKEN 的 Actions secrets (Settings > Secrets)

    关于如何获取 token 点这里

  3. 复制一份 .github/workflows/baidu-submit.yml.sample 文件保存为 .github/workflows/baidu-submit.yml

  4. 替换 .github/workflows/baidu-submit.yml 里的 example.com 为你的网站域名并修改 sitemap 路径

echo "SITE_URL=http://example.com" > .env \
&& echo "SITEMAP_URL=http://example.com/sitemap.xml" >> .env \
  1. 修改要提交的 schedule 时间
schedule:
  - cron: "0 4 * * *"
  - cron: "0 15 * * *"

GitHub Actions 设置的时间为 UTC 时间,4 点等于北京时间 12 点,15 点等于北京时间 23 点。

  1. 保存,提交,完成配置 🚀

每次 action 执行后,可以在 baidu-submit.log 查看执行结果。

其他

如何手动触发提交?

如果想要手动触发提交,可以在 Actions 页面里,选择一个执行过的记录,点击 Re-run jobs 按钮。你也可以提交一次修改,触发 action 执行。

多个网站怎么配置?

如果有多个网站要提交,可以复制一份 baidu-submit.yml 保存为 baidu-submit2.yml ,并修改新的文件里的网站域名和 sitemap 路径。如果新的网站的 baidu api token 不同,添加一个新的 Actions secrets,命名为 BAIDU_TOKEN2,并修改 baidu-submit2.yml 里的内容。

Related

  • baidu-submit.sh - 使用 API 提交方式向百度搜索主动推送 URL 的 shell 脚本

License

Copyright (c) 2021 Pipecraft. Licensed under the MIT license.

>_

Pipecraft PZWD

baidu-submit-github-action's People

Contributors

bytelv avatar pipecraftnet avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.