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 61 62 63
| name: CI
on: push: branches: - master env: GIT_USER: bigsuperangel GIT_EMAIL: bigsuperangel@gmail.com THEME_REPO: bigsuperangel/jacman THEME_BRANCH: master DEPLOY_REPO: bigsuperangel/bigsuperangel.github.io DEPLOY_BRANCH: master
jobs: build: name: Build on node ${{ matrix.node_version }} and ${{ matrix.os }} runs-on: ubuntu-latest strategy: matrix: os: [ubuntu-latest] node_version: [12.x]
steps: - name: Checkout uses: actions/checkout@v2
- name: Checkout theme repo uses: actions/checkout@v2 with: repository: ${{ env.THEME_REPO }} ref: ${{ env.THEME_BRANCH }} path: themes/jacman - name: Checkout deploy repo uses: actions/checkout@v2 with: repository: ${{ env.DEPLOY_REPO }} ref: ${{ env.DEPLOY_BRANCH }} path: .deploy_git
- name: Use Node.js ${{ matrix.node_version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node_version }}
- name: Configuration environment env: HEXO_DEPLOY_PRI: ${{secrets.HEXO_DEPLOY_PRI}} run: | sudo timedatectl set-timezone "Asia/Shanghai" mkdir -p ~/.ssh/ echo "$HEXO_DEPLOY_PRI" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa ssh-keyscan github.com >> ~/.ssh/known_hosts git config --global user.name $GIT_USER git config --global user.email $GIT_EMAIL npm install hexo-cli -g npm install - name: Hexo deploy run: | hexo clean hexo d
|