0x00
blog 配置一下 github actions
0x01
前阵子发现 travis 已经失效,考虑配置一下 github actions
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
| name: blog deploy
on: push: branches: - blog paths: - 'source/**' - 'themes/**' workflow_dispatch:
jobs: build: runs-on: ubuntu-latest strategy: matrix: node-version: [ 12 ] name: A job to deploy blog. steps: - name: Checkout uses: actions/checkout@v1 with: submodules: true
- name: 2. set node version uses: actions/setup-node@master with: node-version: ${{ matrix.node-version }} - name: Cache node modules uses: actions/cache@v1 id: cache with: path: node_modules key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-node- - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: npm ci - name: update blog env: GITHUB_LOGIN: ronething GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | ./node_modules/hexo/bin/hexo clean && ./node_modules/hexo/bin/hexo g cd ./public git init git config user.name "xxxx" git config user.email "xxxx" git add . git commit -m "update blog" git push --force --quiet https://$GITHUB_LOGIN:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git master:master
- name: echo run: | echo "update blog ok"
|
0x02
那么希望可以持续更新下 blog