update 1226 #241
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
env: | |
GIT_USER: codewindy | |
GIT_EMAIL: [email protected] | |
THEME_REPO: forsigner/fexo | |
THEME_BRANCH: master | |
DEPLOY_REPO: codewindy/codewindy.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: [20.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Checkout theme repo | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{ env.THEME_REPO }} | |
ref: ${{ env.THEME_BRANCH }} | |
path: themes/fexo | |
- name: Checkout deploy repo | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{ env.DEPLOY_REPO }} | |
ref: ${{ env.DEPLOY_BRANCH }} | |
path: .deploy_git | |
- name: Use Node.js ${{ matrix.node_version }} | |
uses: actions/setup-node@v3 | |
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 | |
cp _config.yml themes/fexo/_config.yml | |
- name: Install dependencies | |
run: | | |
npm config set strict-ssl false | |
npm config set registry https://registry.npm.taobao.org | |
npm install hexo-cli -g | |
npm install -g npm | |
npm install -f | |
- name: Deploy hexo | |
run: | | |
hexo clean | |
hexo generate | |
hexo d |