Skip to content

fill deploy.steps.setup-node.cache-dependency-path (#2899) #313

fill deploy.steps.setup-node.cache-dependency-path (#2899)

fill deploy.steps.setup-node.cache-dependency-path (#2899) #313

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Deploy
# Controls when the workflow will run
on:
# Triggers the workflow on push event but only for the 6.x branch(required the secrets environment)
push:
branches: [ 6.x ]
tags-ignore:
- '*'
pull_request:
branches: [ 6.x ]
# 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-latest
env:
domain: "https://easywechat.com/"
local_dir: ./docs/.vitepress/dist/
remote_dir: /
thread: 10
region: ap-guangzhou
bucket: "easywechat-1252049834"
ignore: "./.git*,*.DS_Store"
COS_SECRET_ID: ${{ secrets.COS_SECRET_ID }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
run_install: false
- uses: actions/setup-node@v4
with:
node-version: '>=22.12.0'
cache: 'pnpm'
cache-dependency-path: 'docs/pnpm-lock.yaml'
- name: Install dependencies
run: |
cd docs
pnpm install
- name: Build
run: |
cd docs
patch -p1 -i .vitepress/vitepress+1.6.3.patch
pnpm run build
- name: Install coscmd
if: env.COS_SECRET_ID
run: |
python -m pip install --upgrade pip
python -m pip install setuptools
python -m pip install https://github.com/tencentyun/coscmd/archive/refs/heads/master.zip
- name: Upload to cos
if: env.COS_SECRET_ID
run: |
coscmd config -a "${{secrets.COS_SECRET_ID}}" -s "${{secrets.COS_SECRET_KEY}}" -b $bucket -r $region -m $thread
coscmd upload -r -s $local_dir $remote_dir --ignore "$ignore"
- name: Refresh CDN
if: env.COS_SECRET_ID
env:
COS_SECRET_KEY: ${{secrets.COS_SECRET_KEY}}
run: ./docs/pure-caches