mirror of
https://gitee.com/huanghongxun/HMCL-docs.git
synced 2025-12-02 00:32:40 +08:00
仅在监听模式下启用 ruby 缓存 (#322)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
df53ff9f4f
commit
ddf0e0d132
18
.github/workflows/pr-preview.yml
vendored
18
.github/workflows/pr-preview.yml
vendored
@ -12,7 +12,7 @@ env:
|
||||
JEKYLL_ENV: production
|
||||
jobs:
|
||||
preview-remove:
|
||||
if: >-
|
||||
if:
|
||||
${{
|
||||
!github.event.repository.fork && (
|
||||
( github.event_name == 'pull_request_target' && (
|
||||
@ -119,7 +119,7 @@ jobs:
|
||||
name: "preview/watch"
|
||||
});
|
||||
preview-create-init:
|
||||
if: >-
|
||||
if:
|
||||
${{
|
||||
!github.event.repository.fork && (
|
||||
( github.event_name == 'pull_request_target' && (
|
||||
@ -189,6 +189,15 @@ jobs:
|
||||
preview-create-build:
|
||||
needs: preview-create-init
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
PREVIEW_WATCH:
|
||||
${{
|
||||
contains(github.event.pull_request.labels.*.name, 'preview/watch') ||
|
||||
contains(github.event.issue.labels.*.name, 'preview/watch') || (
|
||||
github.event_name == 'issue_comment' &&
|
||||
github.event.comment.body == '/preview watch'
|
||||
)
|
||||
}}
|
||||
outputs:
|
||||
artifact-id: ${{ steps.upload-site.outputs.artifact-id }}
|
||||
steps:
|
||||
@ -207,8 +216,8 @@ jobs:
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: "3.4"
|
||||
bundler-cache: true
|
||||
cache-version: pr${{ env.GITHUB_PR_NUMBER }}
|
||||
bundler-cache: ${{ env.PREVIEW_WATCH }}
|
||||
cache-version: PR-${{ env.GITHUB_PR_NUMBER }}
|
||||
- name: Jekyll Build
|
||||
run: |
|
||||
echo "url: https://${{ needs.preview-create-init.outputs.domain }}" > _action.yml
|
||||
@ -217,6 +226,7 @@ jobs:
|
||||
echo "destination: /home/runner/site" >> _action.yml
|
||||
echo "preview:" >> _action.yml
|
||||
echo " pr-number: ${{ env.GITHUB_PR_NUMBER }}" >> _action.yml
|
||||
${{ env.PREVIEW_WATCH }} || bundle install --jobs 4
|
||||
bundle exec jekyll build --config _config.yml,_action.yml
|
||||
- id: upload-site
|
||||
name: Upload Site
|
||||
|
||||
Loading…
Reference in New Issue
Block a user