# Controls when the action will run. Triggers the workflow on push or pull request # events but only for the hexo branch (change to your hexo blog branch) on: push: branches: [master]
# 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" hexo-deployment: # The type of runner that the job will run on runs-on:ubuntu-latest
# 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 -name:Checkoutsource uses:actions/checkout@v1 with: submodules:true
# Controls when the action will run. Triggers the workflow on push or pull request # events but only for the hexo branch (change to your hexo blog branch) on: push: branches: [master]
# 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" hexo-deployment: # The type of runner that the job will run on runs-on:ubuntu-latest
# 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 -name:Checkoutsource uses:actions/checkout@v1 with: submodules:true
-name:Changepostfilesmodifiedtime run:| find source/_posts -name '*.md' | while read file do touch -d "$(git log -1 --format="@%ct" "$file")" "$file" done -name:Installdependencies run:| yarn global add hexo-cli yarn install -name:Generatesite run:| export PATH="$PATH:`yarn global bin`" hexo clean hexo g -name:Setupossutil uses:manyuanrong/setup-ossutil@v1.0 with: endpoint:'${{ secrets.OSS_ENDPOINT }}' access-key-id:'${{ secrets.OSS_KEY_ID }}' access-key-secret:'${{ secrets.OSS_KEY_SECRET }}'
-uses:actions/cache@v1 id:yarn-cache# use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: path:${{steps.yarn-cache-dir-path.outputs.dir}} key:${{runner.os}}-yarn-${{hashFiles('**/yarn.lock')}} restore-keys:| ${{runner.os}}-yarn-
腾讯云 coscmd 是使用 pip 安装的,如果是使用的 COS 的话还可以缓存 pip 模块提高速度。添加的位置跟上面一样。