Skip to content

Commit 710a7cb

Browse files
committed
2 parents 4280160 + 29d5f42 commit 710a7cb

File tree

2 files changed

+9
-74
lines changed

2 files changed

+9
-74
lines changed

.github/workflows/jekyll.yml

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1 @@
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.
51

6-
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
7-
name: Deploy Jekyll site to Pages
8-
9-
on:
10-
# Runs on pushes targeting the default branch
11-
push:
12-
branches: ["main"]
13-
14-
# Allows you to run this workflow manually from the Actions tab
15-
workflow_dispatch:
16-
17-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
18-
permissions:
19-
contents: read
20-
pages: write
21-
id-token: write
22-
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-
concurrency:
26-
group: "pages"
27-
cancel-in-progress: false
28-
29-
jobs:
30-
# Build job
31-
build:
32-
runs-on: ubuntu-latest
33-
steps:
34-
- name: Checkout
35-
uses: actions/checkout@v3
36-
- name: Setup Ruby
37-
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
38-
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
42-
- name: Setup Pages
43-
id: pages
44-
uses: actions/configure-pages@v3
45-
- name: Build with Jekyll
46-
# Outputs to the './_site' directory by default
47-
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
48-
env:
49-
JEKYLL_ENV: production
50-
- name: Upload artifact
51-
# Automatically uploads an artifact from the './_site' directory by default
52-
uses: actions/upload-pages-artifact@v2
53-
54-
# Deployment job
55-
deploy:
56-
environment:
57-
name: github-pages
58-
url: ${{ steps.deployment.outputs.page_url }}
59-
runs-on: ubuntu-latest
60-
needs: build
61-
steps:
62-
- name: Deploy to GitHub Pages
63-
id: deployment
64-
uses: actions/deploy-pages@v2

.github/workflows/pages-deploy.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: "Build and Deploy"
1+
name: "Build and Deploy Jekyll site to Pages"
2+
23
on:
34
push:
45
branches:
@@ -9,15 +10,13 @@ on:
910
- README.md
1011
- LICENSE
1112

12-
# Allows you to run this workflow manually from the Actions tab
1313
workflow_dispatch:
1414

1515
permissions:
1616
contents: read
1717
pages: write
1818
id-token: write
1919

20-
# Allow one concurrent deployment
2120
concurrency:
2221
group: "pages"
2322
cancel-in-progress: true
@@ -32,22 +31,21 @@ jobs:
3231
with:
3332
fetch-depth: 0
3433
# submodules: true
35-
# If using the 'assets' git submodule from Chirpy Starter, uncomment above
34+
# 如果你使用了git子模块,可以取消注释上述行
3635
# (See: https://github.com/cotes2020/chirpy-starter/tree/main/assets)
3736

38-
- name: Setup Pages
39-
id: pages
40-
uses: actions/configure-pages@v3
41-
4237
- name: Setup Ruby
4338
uses: ruby/setup-ruby@v1
4439
with:
45-
ruby-version: 3 # reads from a '.ruby-version' or '.tools-version' file if 'ruby-version' is omitted
40+
ruby-version: 3 # 自动从 .ruby-version.tools-version 文件读取版本信息,如果未指定
4641
bundler-cache: true
4742

43+
- name: Setup Pages
44+
id: pages
45+
uses: actions/configure-pages@v3
46+
4847
- name: Build site
49-
run: bundle exec jekyll b -d "_site${{ steps.pages.outputs.base_path }}"
50-
48+
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
5149
env:
5250
JEKYLL_ENV: "production"
5351

0 commit comments

Comments
 (0)