Go to Personal Access Tokens generate new token
Access to repo is needed
Copy and store this token, github won't store it for safety
Go to https://github.com/{yourName}/{yourRepo}/settings/secrets
Add a new secret, key is PERSONAL_TOKEN
, value is the token you just generated
Create /.github/workflows/{anyNameYouLike}.yml
Content is like:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
# use any other action here
- name: deploy
uses: wu-yu-xuan/deploy-github-pages@action
with:
personal_token: ${{ secrets.PERSONAL_TOKEN }} # important
commit_message: ${{ github.event.head_commit.message }}
publish_branch: gh-pages
source_dir: build
publish_dir: ./
publish_repo: # like userName/repoName, default is current repo
keep_files: false
or you can read
for more information
- wu-yu-xuan/blog.mscorlib.top
- hamono/bilibili_text
- hamono/bilibili-data
- wu-yu-xuan/json-schema-to-interface
- wu-yu-xuan/deploy-github-pages
If you have trouble using it or have used it, let me known!