|
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 | 1 |
|
6 | 2 | # Sample workflow for building and deploying a Jekyll site to GitHub Pages |
7 | 3 | name: Deploy Jekyll site to Pages |
8 | 4 |
|
9 | 5 | on: |
10 | | - # Runs on pushes targeting the default branch |
11 | 6 | push: |
12 | 7 | branches: ["main"] |
13 | | - |
14 | | - # Allows you to run this workflow manually from the Actions tab |
15 | 8 | workflow_dispatch: |
16 | 9 |
|
17 | | -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
18 | 10 | permissions: |
19 | 11 | contents: read |
20 | 12 | pages: write |
21 | 13 | id-token: write |
22 | 14 |
|
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 | 15 | concurrency: |
26 | 16 | group: "pages" |
27 | 17 | cancel-in-progress: false |
28 | 18 |
|
29 | 19 | jobs: |
30 | | - # Build job |
31 | 20 | build: |
32 | | - runs-on: ubuntu-22.04 |
| 21 | + runs-on: ubuntu-latest |
33 | 22 | steps: |
34 | 23 | - name: Checkout |
35 | 24 | uses: actions/checkout@v4 |
| 25 | + |
36 | 26 | - name: Setup Ruby |
37 | | - uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0 |
| 27 | + uses: ruby/setup-ruby@v1 |
38 | 28 | 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 |
| 29 | + ruby-version: '3.2' |
| 30 | + bundler-cache: false # 禁用缓存 |
| 31 | + |
42 | 32 | - name: Setup Pages |
43 | 33 | id: pages |
44 | 34 | uses: actions/configure-pages@v5 |
| 35 | + |
| 36 | + - name: Install dependencies |
| 37 | + run: | |
| 38 | + gem install bundler |
| 39 | + bundle install |
| 40 | + |
45 | 41 | - name: Build with Jekyll |
46 | | - # Outputs to the './_site' directory by default |
47 | 42 | run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" |
48 | 43 | env: |
49 | 44 | JEKYLL_ENV: production |
| 45 | + |
50 | 46 | - name: Upload artifact |
51 | | - # Automatically uploads an artifact from the './_site' directory by default |
52 | 47 | uses: actions/upload-pages-artifact@v3 |
53 | 48 |
|
54 | | - # Deployment job |
55 | 49 | deploy: |
56 | 50 | environment: |
57 | 51 | name: github-pages |
|
0 commit comments