ci: update actions #25
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: 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 | |
# Deploy hexo blog website. | |
- name: Deploy | |
id: deploy | |
uses: sma11black/hexo-action@v1.0.4 | |
with: | |
deploy_key: ${{ secrets.DEPLOY_KEY }} | |
# Use the output from the `deploy` step(use for test action) | |
- name: Get the output | |
run: | | |
echo "${{ steps.deploy.outputs.notify }}" |