TencentCloudBase / cloudbase-action

云开发 Tencent CloudBase Github Action 可以将 Github 项目自动部署到云开发环境,基于 CloudBase Framework,支持静态网站、云函数、云托管、小程序等项目

Home Page:https://cloudbase.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

关于使用 Hexo Action 后的部署的一些问题

vinceying opened this issue · comments

commented

使用 Hexo Action( https://github.com/DeppWang/hexo-action )后,有两个仓库(仓库一作为 Hexo 的源码仓库,仓库二作为 ./public/ 目录),在仓库二使用 cloudbase-action 后,每次 push 相关内容到仓库一,执行 hexo d 操作后仓库二的 cloudbase-action 相关配置文件就会被删除,请问有什么好的解决方法吗?

仓库二的 cloudbase-action 相关配置文件是什么

commented

仓库二的 cloudbase-action 相关配置文件是什么

感谢回复,可能没有表达清楚,是 Repo/.github/workflows/*.yml 。这个应该是 hexo d 的问题。
目前在想如何通过仓库1的 Github Actions 解决。

hexo g -d 会生成静态文件,然后调用deploy命令来部署

如果是走git部署,他会完全清理掉要部署到git仓库的文件,然后把生成的静态文件部署上去

https://hexo.io/zh-cn/docs/one-command-deployment

跟你使用的 Hexo Action 有关,他会默认执行这些部署操作

可以看下这个 Action

https://github.com/marketplace/actions/github-action-for-hexo

on: push
name: Deploy
jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
    - name: Clean
      uses: heowc/action-hexo@master
      with:
        args: clean
    - name: Generate
      uses: heowc/action-hexo@master
      with:
        args: generate
   - name: Deploy static to Tencent CloudBase
        id: deployStatic
        uses: TencentCloudBase/cloudbase-action@v1.1.0
        with:
          secretId: ${{ secrets.SECRET_ID }}
          secretKey: ${{ secrets.SECRET_KEY }}
          envId: ${{ secrets.ENV_ID }}
          staticSrcPath: public
commented

非常感谢回复,那个 Action 好像是代码冲突,已经通过以下 Action 解决。

name: Deploy to Tencent CloudBase

on: push

jobs:
  build:
    runs-on: ubuntu-latest
    name: Deploy Heox Souce Repo to Tencent CloudBase
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Setup Node
        uses: actions/setup-node@v1
        with:
          node-version: '10.x'
      - name: NPM
        run: npm install
      - name: Clean
        run: ./node_modules/.bin/hexo clean
      - name: Generate
        run: ./node_modules/.bin/hexo generate
      - name: Deploy static to Tencent CloudBase
        id: deployStatic
        uses: TencentCloudBase/cloudbase-action@v1.1.0
        with:
          secretId: ${{ secrets.SECRET_ID }}
          secretKey: ${{ secrets.SECRET_KEY }}
          envId: ${{ secrets.ENV_ID }}
          staticSrcPath: public