Skip to content

Commit 03be2f1

Browse files
committed
github action
1 parent 738d924 commit 03be2f1

File tree

2 files changed

+40
-9
lines changed

2 files changed

+40
-9
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build and Deploy to Github Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master # Here source code branch is `master`, it could be other branch
7+
8+
jobs:
9+
build_and_deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
# Use GitHub Actions' cache to cache dependencies on servers
15+
- uses: actions/cache@v4
16+
with:
17+
path: |
18+
.asdf/**
19+
vendor/bundle
20+
key: ${{ runner.os }}-cache-${{ hashFiles('**/cache.key') }}
21+
restore-keys: |
22+
${{ runner.os }}-cache-
23+
24+
# Use GitHub Deploy Action to build and deploy to Github
25+
# For latest version: `jeffreytse/jekyll-deploy-action@master`
26+
- uses: jeffreytse/[email protected]
27+
with:
28+
provider: "github" # Default is github
29+
token: ${{ secrets.GITHUB_TOKEN }} # It's your Personal Access Token(PAT)
30+
branch: "master" # Default is gh-pages for github provider
31+
jekyll_src: "./" # Default is root directory
32+
jekyll_cfg: "_config.yml" # Default is _config.yml

.github/workflows/jekyll.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@ name: Jekyll Action CI
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [master]
66
pull_request:
7-
branches: [ master ]
7+
branches: [master]
88

99
jobs:
1010
build:
11-
1211
runs-on: ubuntu-latest
1312

1413
steps:
15-
- uses: actions/checkout@v2
16-
- name: Build the site in the jekyll/builder container
17-
run: |
18-
docker run \
19-
-v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \
20-
jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future"
14+
- uses: actions/checkout@v2
15+
- name: Build the site in the jekyll/builder container
16+
run: |
17+
docker run \
18+
-v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \
19+
jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future"

0 commit comments

Comments
 (0)