10
10
# Runs on pushes targeting the default branch
11
11
push :
12
12
branches : [ $default-branch ]
13
+ paths :
14
+ - " docs/**"
13
15
pull_request :
14
16
branches : [ 'main', '2.x' ]
15
17
types : [ opened ]
18
+ paths :
19
+ - " docs/**"
16
20
17
21
# Allows you to run this workflow manually from the Actions tab
18
22
workflow_dispatch :
33
37
# Build and Deploy job
34
38
build_and_deploy :
35
39
runs-on : ubuntu-latest
40
+ defaults :
41
+ run :
42
+ working-directory : docs
36
43
steps :
37
44
- name : Checkout
38
45
uses : actions/checkout@v4
@@ -42,32 +49,29 @@ jobs:
42
49
ruby-version : ' 3.1' # Not needed with a .ruby-version file
43
50
bundler-cache : true # runs 'bundle install' and caches installed gems automatically
44
51
cache-version : 0 # Increment this number if you need to re-download cached gems
52
+ working-directory : ' ${{ github.workspace }}/docs'
53
+ - name : Setup Pages
54
+ id : pages
55
+ uses : actions/configure-pages@v5
45
56
- name : Bundle install in docs folder
46
- run : |
47
- cd docs
48
- bundle install
57
+ run : bundle install
49
58
- name : Build Jekyll site
50
- run : |
51
- cd docs
52
- bundle exec jekyll build --baseurl /rqueue
53
- mkdir -p _site # Ensure _site directory exists
59
+ run : bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
54
60
env :
55
61
JEKYLL_ENV : production
56
- - name : Verify _site directory
57
- run : |
58
- cd docs
59
- ls -l _site
60
62
- name : Upload artifact
61
63
# Automatically uploads an artifact from the './_site' directory by default
62
64
uses : actions/upload-artifact@v2
63
65
with :
64
66
name : Jekyll site
65
- path : docs/_site
67
+ path : " docs/_site"
66
68
- name : Deploy to GitHub Pages
67
- uses :
JamesIves/github-pages- deploy-[email protected] # Replace with the appropriate deploy action
69
+ uses : actions/ deploy-pages@v4
68
70
with :
69
71
branch : $default-branch
70
- folder : docs/_site
72
+ folder : " docs/_site"
71
73
env :
72
74
JEKYLL_ENV : production
73
- BASE_URL : /rqueue
75
+ BASE_URL : /rqueue
76
+ name : github-pages
77
+ url : ${{ steps.deployment.outputs.page_url }}
0 commit comments