Skip to content

Commit 08dffcb

Browse files
committed
CI: workflow setup
1 parent e81aed7 commit 08dffcb

2 files changed

Lines changed: 43 additions & 26 deletions

File tree

.github/workflows/pages-deploy.yml

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,34 @@
1-
name: "Build and Deploy"
1+
name: "Deploy"
22
on:
33
push:
44
branches:
55
- main
6-
- master
76
paths-ignore:
87
- .gitignore
98
- README.md
109
- LICENSE
11-
12-
# Allows you to run this workflow manually from the Actions tab
1310
workflow_dispatch:
1411

1512
permissions:
1613
contents: read
1714
pages: write
1815
id-token: write
1916

20-
# Allow one concurrent deployment
2117
concurrency:
2218
group: "pages"
2319
cancel-in-progress: true
2420

2521
jobs:
26-
build:
22+
deploy:
2723
runs-on: ubuntu-latest
24+
environment:
25+
name: github-pages
26+
url: ${{ steps.deployment.outputs.page_url }}
2827
steps:
2928
- name: Checkout
3029
uses: actions/checkout@v4
3130
with:
3231
fetch-depth: 0
33-
# submodules: true
34-
# If using the 'assets' git submodule from Chirpy Starter, uncomment above
35-
# (See: https://github.com/cotes2020/chirpy-starter/tree/main/assets)
3632

3733
- name: Setup Pages
3834
id: pages
@@ -41,32 +37,19 @@ jobs:
4137
- name: Setup Ruby
4238
uses: ruby/setup-ruby@v1
4339
with:
44-
ruby-version: 3.4
40+
ruby-version: 3.3
4541
bundler-cache: true
4642

4743
- name: Build site
4844
run: bundle exec jekyll b -d "_site${{ steps.pages.outputs.base_path }}"
4945
env:
5046
JEKYLL_ENV: "production"
5147

52-
- name: Test site
53-
run: |
54-
bundle exec htmlproofer _site \
55-
\-\-disable-external \
56-
\-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"
57-
58-
- name: Upload site artifact
59-
uses: actions/upload-pages-artifact@v4
48+
- name: Upload artifact
49+
uses: actions/upload-pages-artifact@v3
6050
with:
6151
path: "_site${{ steps.pages.outputs.base_path }}"
6252

63-
deploy:
64-
environment:
65-
name: github-pages
66-
url: ${{ steps.deployment.outputs.page_url }}
67-
runs-on: ubuntu-latest
68-
needs: build
69-
steps:
7053
- name: Deploy to GitHub Pages
7154
id: deployment
72-
uses: actions/deploy-pages@v4
55+
uses: actions/deploy-pages@v4

.github/workflows/pr-build.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "PR Build Check"
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Setup Ruby
20+
uses: ruby/setup-ruby@v1
21+
with:
22+
ruby-version: 3.3
23+
bundler-cache: true
24+
25+
- name: Build site
26+
run: bundle exec jekyll b -d "_site"
27+
env:
28+
JEKYLL_ENV: "production"
29+
30+
- name: Test site
31+
run: |
32+
bundle exec htmlproofer _site \
33+
--disable-external \
34+
--ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"

0 commit comments

Comments
 (0)