Generate Hexo Web Page #528
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/Push Changes | |
# # You may pin to the exact commit or the version. | |
# # uses: actions-x/commit@0430155bf5e2dd295026c0fc853dfeb0d3c0fe1a | |
# uses: actions-x/commit@v4 | |
# with: | |
# # The committer's email address | |
# email: github-actions-git-commit@users.noreply.github.com | |
# # The committer's name | |
# name: Github Actions - Git Commit | |
# # The commit message | |
# message: Github Actions - Git Commit | |
# # The branch to push the changes back to, defaults to the current branch | |
# branch: ${{ github.ref }} | |
# # The files to add separated by space, defaults to every file | |
# files: . | |
# # The repository to push the code to, defaults to origin (e.g. this repository) | |
# repository: origin | |
# # The token used to push the code, not needed if you push to the same repository | |
# token: ${{ secrets.token }} | |
# # Whether to perform force push | |
# force: 0 | |
# # The working directory that will be used for git commands | |
# directory: . | |
- 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.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 |