|
1 |
| -# This workflow uses actions that are not certified by GitHub. |
2 |
| -# They are provided by a third-party and are governed by |
3 |
| -# separate terms of service, privacy policy, and support |
4 |
| -# documentation. |
5 |
| - |
6 |
| -# Sample workflow for building and deploying a Jekyll site to GitHub Pages |
7 | 1 | name: Deploy Jekyll site to Pages
|
8 | 2 |
|
9 | 3 | on:
|
10 |
| - # Runs on pushes targeting the default branch |
11 | 4 | push:
|
12 | 5 | branches: ["main"]
|
13 |
| - |
14 |
| - # Allows you to run this workflow manually from the Actions tab |
15 | 6 | workflow_dispatch:
|
16 | 7 |
|
17 |
| -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
18 | 8 | permissions:
|
19 | 9 | contents: read
|
20 | 10 | pages: write
|
21 | 11 | id-token: write
|
22 | 12 |
|
23 |
| -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
24 |
| -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
25 | 13 | concurrency:
|
26 | 14 | group: "pages"
|
27 | 15 | cancel-in-progress: false
|
28 | 16 |
|
29 | 17 | jobs:
|
30 |
| - # Build job |
31 | 18 | build:
|
32 | 19 | runs-on: ubuntu-latest
|
33 | 20 | steps:
|
34 | 21 | - name: Checkout
|
35 | 22 | uses: actions/checkout@v3
|
| 23 | + |
36 | 24 | - name: Setup Ruby
|
37 |
| - uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0 |
| 25 | + uses: ruby/setup-ruby@v1 # 使用版本标记 |
38 | 26 | with:
|
39 |
| - ruby-version: '3.1' # Not needed with a .ruby-version file |
40 |
| - bundler-cache: true # runs 'bundle install' and caches installed gems automatically |
41 |
| - cache-version: 0 # Increment this number if you need to re-download cached gems |
| 27 | + ruby-version: '3.1' |
| 28 | + bundler-cache: true |
| 29 | + cache-version: 1 # 增加缓存版本号以强制更新缓存 |
| 30 | + |
42 | 31 | - name: Setup Pages
|
43 | 32 | id: pages
|
44 | 33 | uses: actions/configure-pages@v3
|
| 34 | + |
45 | 35 | - name: Build with Jekyll
|
46 |
| - # Outputs to the './_site' directory by default |
47 | 36 | run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
|
48 | 37 | env:
|
49 | 38 | JEKYLL_ENV: production
|
| 39 | + |
50 | 40 | - name: Upload artifact
|
51 |
| - # Automatically uploads an artifact from the './_site' directory by default |
52 | 41 | uses: actions/upload-pages-artifact@v2
|
53 | 42 |
|
54 |
| - # Deployment job |
55 | 43 | deploy:
|
56 | 44 | environment:
|
57 | 45 | name: github-pages
|
|
0 commit comments