1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| name: Hexo Auto-Deploy on: [push]
jobs: build: name: Hexo Auto-Deploy by GitHub Actions runs-on: ubuntu-latest
steps: - name: 1. git checkout... uses: actions/checkout@v1 - name: 2. setup nodejs... uses: actions/setup-node@v1 - name: 3. install hexo... run: | npm install hexo-cli -g npm install - name: 4. hexo generate public files... run: | hexo clean hexo g
- name: 5. hexo deploy ... run: | mkdir -p ~/.ssh/ echo "${{ secrets.GITHUB_ACTION }}" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa ssh-keyscan github.com >> ~/.ssh/known_hosts git config --global user.name "XXXXXX" git config --global user.email "XXXXXX@XXXXXX.com" git config --global core.quotepath false hexo d
|