Skip to content

[stdf]Publish stdf@next.4 #10

[stdf]Publish stdf@next.4

[stdf]Publish stdf@next.4 #10

# 当分支 next 分支有 push 事件,并且此次 push 包含了 packages/stdf 目录下的文件时触发,使用 GitHub Actions 执行
name: SYNC NEXT DEMO
on:
push:
branches:
- next
paths:
- 'packages/stdf/**'
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# clone 仓库 github.com/any-tdf/stdf
- name: Clone stdf
uses: actions/checkout@v4
with:
repository: any-tdf/stdf
token: ${{ secrets.STDF_GITHUB_TOKEN }}
path: stdf
# 切换到 next 分支
- name: Checkout next
run: |
git checkout next
- name: Init stdf demo
run: |
cp stdf/LICENSE stdf/packages/stdf/LICENSE
cd stdf/packages/stdf
git init
git config --global user.name 'GitHub Actions'
git config --global user.email 'GitHub Actions'
git add .
git commit -m "Github Actions auto commit: update demo from stdf."
# 将修改内容推送到 git@github.com:any-tdf/next-demo-stdf.git 的 main 分支
- name: Push to next-demo-stdf
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.STDF_GITHUB_TOKEN }}
branch: main
force: true
directory: stdf/packages/stdf
repository: any-tdf/next-demo-stdf