Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Add updates for two posts #140

Add updates for two posts

Add updates for two posts #140

Workflow file for this run

name: Push to Github Pages
on:
push:
branches:
- blog
# schedule:
# - cron: '0 0,12 * * *'
jobs:
generate:
# if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- name: Checkout the Blog Repository
uses: actions/checkout@v2
with:
ref: blog
submodules: recursive
fetch-depth: 0
- name: Set Up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
# - name: Clone the Code Repository
# run: |
# git clone https://github.com/xinchengo/code.git
- name: Generate Mkdocs
run: |
pip install mkdocs-material
pip install mkdocs-roamlinks-plugin
pip install mkdocs-git-revision-date-localized-plugin
pip install mkdocs-literate-nav
mkdocs gh-deploy --force
# baidu-push:
# needs: generate
# runs-on: ubuntu-latest
# steps:
# - name: Checkout the Pages Repository
# uses: actions/checkout@v2
# with:
# ref: gh-pages
# fetch-depth: 0
# - name: Set Up Python
# uses: actions/setup-python@v2
# with:
# python-version: 3.x
# - name: Preparation
# run: |
# printf "from bs4 import BeautifulSoup as bs\nfilename = './sitemap.xml'\nf = open(filename)\nfile = f.read()\nsoup = bs(file, \"html.parser\")\nlinks = soup.find_all('loc')\nwith open('./urls.txt', 'w') as f1:\n for link in links:\n f1.write(link.text + '\\\n')\n" > script.py
# pip install bs4
# - name: Generate Sitemap
# run: |
# python ./script.py
# - name: Push to baidu
# env:
# URL: ${{ secrets.BAIDU_PUSH_URL }}
# run: |
# curl -H 'Content-Type:text/plain' --data-binary @urls.txt "$URL"