Skip to content

v2.4.0

v2.4.0 #34

Workflow file for this run

# workflow 名称,执行时的标题
name: Publish to Aliyun
# 触发条件
on:
release:
types: [published]
# 不清楚干嘛的,保留着
workflow_dispatch:
# 真正的任务
jobs:
# job 名称
build:
# 运行环境
runs-on: ubuntu-latest
# 步骤
# 1. checkout repo
steps:
- name: Checkout Repository
uses: actions/checkout@v3
# 2. 配置 node
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
# 3. OSS 脚本相关配置
- name: Setup Aliyun OSS
uses: manyuanrong/setup-ossutil@master
with:
endpoint: ${{ secrets.ALI_ENDPOINT }}
access-key-id: ${{ secrets.ALI_ACCESSKEYID }}
access-key-secret: ${{ secrets.ALI_ACCESSKEYSECRET }}
# 4. 执行 OSS 脚本,ossutil 用法 `https://help.aliyun.com/document_detail/50452.html`
- name: Upload to Aliyun OSS
# run: ossutil cp -r source/ oss://${{ secrets.ALI_BUCKET }}/projects/hexo-theme-redefine/${{ github.event.release.name }}/source/
run: |
VERSION=$(echo ${{ github.event.release.name }} | sed 's/v//') # Remove the 'v' prefix from the release name
ossutil cp -r source/ oss://${{ secrets.ALI_BUCKET }}/projects/hexo-theme-redefine@$VERSION/source/