Skip to content

Commit 944fa23

Browse files
Include drafts in branch builds (#48)
* Include drafts in branch builds * Replace underscore with dash in step id
1 parent 7adb2b4 commit 944fa23

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/deploy-cloudflare.yaml

+11-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,17 @@ jobs:
1313
steps:
1414
- name: Check out repository
1515
uses: actions/checkout@v4
16+
- name: Extract branch name
17+
shell: bash
18+
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
19+
id: extract-branch
1620
- name: Install gems
1721
run: bundle install
18-
- name: Build website
22+
- name: Build website (non-production)
23+
if: steps.extract-branch.outputs.branch != 'main'
24+
run: bundle exec jekyll build --drafts
25+
- name: Build website (production)
26+
if: steps.extract-branch.outputs.branch == 'main'
1927
run: bundle exec jekyll build
2028
env:
2129
JEKYLL_ENV: production
@@ -47,7 +55,7 @@ jobs:
4755
- name: Extract branch name
4856
shell: bash
4957
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
50-
id: extract_branch
58+
id: extract-branch
5159
- name: Download built website
5260
uses: actions/download-artifact@v4
5361
with:
@@ -62,7 +70,7 @@ jobs:
6270
with:
6371
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
6472
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
65-
command: pages deploy _site --project-name=beh-uk --branch=${{ steps.extract_branch.outputs.branch }} --commit-dirty=true
73+
command: pages deploy _site --project-name=beh-uk --branch=${{ steps.extract-branch.outputs.branch }} --commit-dirty=true
6674

6775
deploy-d1:
6876
needs: [build-jekyll, validate-d1]

0 commit comments

Comments
 (0)