Skip to content

Commit bfbd513

Browse files
Create pages.yml
Signed-off-by: weiyunshu1994 <[email protected]>
1 parent 40b2ebf commit bfbd513

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/pages.yml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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+
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 one concurrent deployment
24+
concurrency:
25+
group: "pages"
26+
cancel-in-progress: true
27+
28+
jobs:
29+
# Build job
30+
build:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v3
35+
- name: Setup Ruby
36+
uses: ruby/setup-ruby@0a29871fe2b0200a17a4497bae54fe5df0d973aa # v1.115.3
37+
with:
38+
ruby-version: '3.0' # Not needed with a .ruby-version file
39+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
40+
cache-version: 0 # Increment this number if you need to re-download cached gems
41+
- name: Setup Pages
42+
id: pages
43+
uses: actions/configure-pages@v2
44+
- name: Build with Jekyll
45+
# Outputs to the './_site' directory by default
46+
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
47+
env:
48+
JEKYLL_ENV: production
49+
- name: Upload artifact
50+
# Automatically uploads an artifact from the './_site' directory by default
51+
uses: actions/upload-pages-artifact@v1
52+
53+
# Deployment job
54+
deploy:
55+
environment:
56+
name: github-pages
57+
url: ${{ steps.deployment.outputs.page_url }}
58+
runs-on: ubuntu-latest
59+
needs: build
60+
steps:
61+
- name: Deploy to GitHub Pages
62+
id: deployment
63+
uses: actions/deploy-pages@v1

0 commit comments

Comments
 (0)