Skip to content

Commit 55ed75b

Browse files
committed
Draft idea for building edition websites
1 parent bceadf0 commit 55ed75b

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/build.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- v*
78

89
jobs:
910
build-book:
@@ -76,6 +77,7 @@ jobs:
7677
run: cd website && make
7778

7879
- name: Deploy website index
80+
if: github.ref == 'refs/heads/main'
7981
uses: JamesIves/github-pages-deploy-action@v4.6.1
8082
with:
8183
folder: website
@@ -95,6 +97,7 @@ jobs:
9597
# run: cd source && ninja python-book-pdf
9698

9799
- name: Deploy Python book
100+
if: github.ref == 'refs/heads/main'
98101
uses: JamesIves/github-pages-deploy-action@v4.6.1
99102
with:
100103
folder: python-book
@@ -113,10 +116,30 @@ jobs:
113116
# run: cd source && ninja python-book-pdf
114117

115118
- name: Deploy R book
119+
if: github.ref == 'refs/heads/main'
116120
uses: JamesIves/github-pages-deploy-action@v4.6.1
117121
with:
118122
folder: r-book
119123
repository-name: resampling-stats/r-book
120124
branch: main
121125
single-commit: true
122126
token: ${{ secrets.BOOK_UPLOAD_TOKEN }}
127+
128+
# If we're building a set edition, such as v3, push all into
129+
# same repo
130+
131+
- name: Setup book edition for deployment
132+
if: startsWith(github.ref, 'refs/heads/v')
133+
run: |
134+
cp -r r-book website
135+
cp -r python-book website
136+
137+
- name: Deploy book edition
138+
if: startsWith(github.ref, 'refs/heads/v')
139+
uses: JamesIves/github-pages-deploy-action@v4.6.1
140+
with:
141+
folder: website
142+
repository-name: "resampling-stats/${{ github.ref_name }}"
143+
branch: main
144+
single-commit: true
145+
token: ${{ secrets.BOOK_UPLOAD_TOKEN }}

0 commit comments

Comments
 (0)