Generate Hexo Web Page #941
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Generate Hexo Web Page | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: '7 23 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.6 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 pytest | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Generate Web Pages | |
env: # Or as an environment variable | |
A_GITHUB_TOKEN: ${{ secrets.A_GITHUB_TOKEN }} | |
run: | | |
python get_info.py | |
python generate_html.py | |
- name: Git Commit and Push | |
# You may pin to the exact commit or the version. | |
# uses: github-actions-x/commit@722d56b8968bf00ced78407bbe2ead81062d8baa | |
uses: github-actions-x/commit@v2.9 | |
with: | |
# Github Token with commit access | |
github-token: ${{ secrets.A_GITHUB_TOKEN }} | |
# Override branch to push to | |
push-branch: master | |
# Specify commit message | |
commit-message: Github Actions - Git Commit | |
# Force add files, useful for adding ignored files. | |
force-add: false | |
# Force push. | |
force-push: true | |
# Pull and rebase before commiting. Useful when using commit inside matrix. | |
rebase: false | |
# Specific files to add. | |
files: . | |
# Committer email. Default is ${name}@users.noreply.github.com | |
email: ${name}@users.noreply.github.com | |
# Committer name. Default is name of the person or app that initiated the workflow. | |
name: Github Actions - Git Commit |