-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
github actions的lastGeneratePath.log问题 #128
Comments
我在使用github actions将github private仓库的代码自动部署到github pages上,但这过程中发现个问题,无法写入更新时间到private仓库的lastGeneratePath.log里,请问是否有好的办法,github actions代码如下:
|
看不出来问题在哪,但是部署到githubpages有插件的,可以试一下以下流程
|
至于第三步 推送代码到博客源码仓库。我也使用的插件
|
参考我的部署配置 name: Deplo
on:
# 允许手动push触发
push:
branches:
- master
# 允许外部仓库事件触发
repository_dispatch:
types:
- start
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 检查分支
uses: actions/checkout@master
- name: 安装node环境
uses: actions/setup-node@master
with:
node-version: "12.x"
- name: 缓存依赖
uses: actions/cache@v1
id: cache
with:
path: node_modules
key: ${{runner.OS}}-${{hashFiles('**/package-lock.json')}}
- name: 安装依赖
if: steps.cache.outputs.cache-hit != 'true'
run: |
export TZ='Asia/Shanghai'
npm install
- name: 拉取语雀的文章
env:
YUQUE_TOKEN: ${{ secrets.YUQUE_TOKEN }}
run: |
npm run yuque:sync // yuque-hexo sync
- name: 配置Git用户名邮箱
run: |
git config --global user.name "1874"
git config --global user.email "[email protected]"
- name: 提交yuque拉取的文章到GitHub源码仓库
run: |
echo `date +"%Y-%m-%d %H:%M:%S"` begin > time.txt
git add .
git commit -m "Refresh yuque json" -a
- name: 推送文章到仓库
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: 生成静态文件
run: |
npm run hexo:clean // hexo clean
npm run hexo:build // hexo generate
- name: 上传文章到GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.SSH_PRIVATE_KEY }}
external_repository: LetTTGACO/LetTTGACO.github.io
publish_branch: master
publish_dir: ./public
commit_message: ${{ github.event.head_commit.message }}
|
我的意思是,每次从博客源码仓库用github actions部署到github pages仓库,actions里每次都必须拉取语雀所有文章,然后再重新生成到github pages吗?因为lastGeneratePath.log无法起作用... |
不会啊,我的就是这么配置的,能正常提交的,lastGeneratePath.log写入我倒是没遇到过,可以看下日志。 |
问题在下一条
The text was updated successfully, but these errors were encountered: