Skip to content

Instantly share code, notes, and snippets.

@Gesrua
Created August 30, 2019 05:10
Show Gist options
  • Save Gesrua/5b8090aadd4132502bab0af94a43aaa3 to your computer and use it in GitHub Desktop.
Save Gesrua/5b8090aadd4132502bab0af94a43aaa3 to your computer and use it in GitHub Desktop.
GitHub Actions Hexo
name: CI
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: 10.x
- name: Install Dependencies
run: |
git submodule init
git submodule update
npm install -g hexo
npm install
- name: Clean
run: hexo clean
- name: Generate
run: hexo generate
- name: Checkdir
run: ls ./public
- name: Deploy
env:
GH_PAT: ${{ secrets.GH_PAT }}
Page_repo: "Chaigidel/chaigidel.github.io"
run: sh publish-to-gh-pages.sh
#!/bin/bash
set -ev
remote_repo="https://${GH_PAT}@github.com/${Page_repo}.git"
remote_branch="master"
cd public
git init
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add .
git commit -m "Auto Builder at `date +"%Y-%m-%d %H:%M"` from ${GITHUB_REPOSITORY}"
git push --force "${remote_repo}" master:${remote_branch}
echo "Deploy complete"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment