Skip to content

Commit 744ee49

Browse files
committed
update
1 parent e44713d commit 744ee49

File tree

1 file changed

+64
-15
lines changed

1 file changed

+64
-15
lines changed

.github/workflows/ci-workflow.yml

Lines changed: 64 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,71 @@ on:
66
pull_request:
77
branches: [ main ]
88

9+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
16+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
20+
921
jobs:
10-
build-site:
11-
name: Build and Test
22+
# Build job
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
- name: Setup Ruby
29+
# https://github.com/ruby/setup-ruby/releases/tag/v1.207.0
30+
uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4
31+
with:
32+
ruby-version: '3.1' # Not needed with a .ruby-version file
33+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
34+
cache-version: 0 # Increment this number if you need to re-download cached gems
35+
- name: Setup Pages
36+
id: pages
37+
uses: actions/configure-pages@v5
38+
- name: Build with Jekyll
39+
# Outputs to the './_site' directory by default
40+
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
41+
env:
42+
JEKYLL_ENV: production
43+
- name: Upload artifact
44+
# Automatically uploads an artifact from the './_site' directory by default
45+
uses: actions/upload-pages-artifact@v3
46+
47+
# Deployment job
48+
deploy:
49+
environment:
50+
name: github-pages
51+
url: ${{ steps.deployment.outputs.page_url }}
1252
runs-on: ubuntu-latest
53+
needs: build
1354
steps:
14-
- uses: actions/checkout@v4
15-
- name: Set up Ruby
16-
uses: ruby/setup-ruby@v1
17-
with:
18-
ruby-version: '3.1'
19-
bundler-cache: true
20-
- name: Build Main Site
21-
run: bundle exec jekyll build -d _site
55+
- name: Deploy to GitHub Pages
56+
id: deployment
57+
uses: actions/deploy-pages@v4
58+
# jobs:
59+
# build-site:
60+
# name: Build and Test
61+
# runs-on: ubuntu-latest
62+
# steps:
63+
# - uses: actions/checkout@v4
64+
# - name: Set up Ruby
65+
# uses: ruby/setup-ruby@v1
66+
# with:
67+
# ruby-version: '3.1'
68+
# bundler-cache: true
69+
# - name: Build Main Site
70+
# run: bundle exec jekyll build -d _site
2271

23-
- name: Deploy to GitHub Pages
24-
uses: peaceiris/actions-gh-pages@v3
25-
with:
26-
github_token: ${{ secrets.GITHUB_TOKEN }}
27-
publish_dir: ./_site # 部署 Jekyll 生成的静态文件
72+
# - name: Deploy to GitHub Pages
73+
# uses: peaceiris/actions-gh-pages@v3
74+
# with:
75+
# github_token: ${{ secrets.GITHUB_TOKEN }}
76+
# publish_dir: ./_site # 部署 Jekyll 生成的静态文件

0 commit comments

Comments
 (0)