Skip to content

ci: deploy manually #28

ci: deploy manually

ci: deploy manually #28

Workflow file for this run

name: Deploy Hexo site
on:
push:
branches: [ source ]
jobs:
build:
runs-on: ubuntu-latest
name: A job to deploy blog.
env:
node_version: '16.x'
steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
# SHould match the version used by hexo-action
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ env.node_version }}
- name: Install pnpm
uses: pnpm/action-setup@v4
id: pnpm-install
# Caching dependencies to speed up workflows.
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install Dependencies
run: pnpm install
# Begin: Deploy hexo blog website.
- name: Install hexo-cli
run: pnpm install hexo-cli -g
- name: Sync master branch
uses: actions/checkout@v2
with:
ref: refs/heads/master
path: .deploy_git
- name: Deploy
run: hexo g -d
# End: Deploy hexo blog website.
# Use the output from the `deploy` step(use for test action)
- name: Get the output
run: |
echo "${{ steps.deploy.outputs.notify }}"