博客搭建
作者:互联网
Author: meteor
date: 2022-08-20 13:02:54
LastEditTime: 2022-08-20 13:07:57
title: 博客搭建
tags:
hexo+github+action+pages
# This is a basic workflow to help you get started with Actions
name: Hexo-deploy
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-18.04
if: github.event.repository.owner.id == github.event.sender.id
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout source
uses: actions/checkout@v2
with:
ref: master
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '12'
- name: Setup Hexo
env:
ACTION_DEPLOY_KEY: ${{ secrets.HEXO }}
run: |
mkdir -p ~/.ssh/
echo "$ACTION_DEPLOY_KEY" > ~/.ssh/id_rsa
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
git config --global user.email "你的邮箱"
git config --global user.name "你的名字"
npm install hexo-cli -g
npm install
- name: Deploy
run: |
hexo clean
hexo deploy
${{ secrets.HEXO }}要改为你自己私钥名称
标签:run,name,hexo,workflow,博客,ssh,id,搭建 来源: https://www.cnblogs.com/hslxy/p/16607562.html