Fxxk Travis Ci stopped generating my page
One day, After I updated some blog and there was no update on my Github page blog, then I checked the Travis-CI, it showed Builds have been temporarily disabled for public repositories
Then, whatever, F it. I spent more than 2 hours setting up my Credit Card to activate the Travis-CI service, and now It just down and without any notifications.
Back to GitHub actions
Luckily, Github provides the workflows with actions.
sequenceDiagram participant LA as Local participant RM as Repo Master Branch participant RP as Repo gh-pages Branch participant GA as Github Actions LA ->> LA: hexo new page LA ->> LA: hexo s, setup preview server LA ->> LA: http://127.0.0.1:4000 preview LA --> LA: add github actions workflow yaml LA ->> RM: Push to Master RM ->> GA: Trigger actions GA ->> GA: Setup node GA ->> GA: Install package GA ->> GA: Generate static blog page GA ->> RP: Push to Repo publish branch
Github workflow yaml setting
Code talks firstly
1 | # This workflow will do a clean install of |
Workflow detail
Setup basic Node based on ubuntu
1 | on: |
Install hexo to CI system and build
1 | - name: Setup Env |
if we do not install this version globally, then the CI will not find the hexo command.
Install other packages and generate the static page
1 | npm install |
Deploy to Repo gh-pages branch with deploy tools
1 | - name: Deploy |
It will deploy your Ci public directory to your repo gh_pages branch.
If you need more help, just peaceiris/actions-gh-pages@v3 pages for more help.
This actions support many tokens
If you just need https, choose github_token, and if you prefer to ssh, you can use deploy_key(it’s my style)