Skip to content

Commit 63bbcff

Browse files
authored
Merge pull request #27 from nuttycom/fix-render-site
Add pull-request render test & clean up publish action.
2 parents fd46897 + a0d579a commit 63bbcff

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed
Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# Inspired by https://nathan-at-least.github.io/auto-deploy-howto.html
21
name: Deploy Rendered Site
32

43
on:
@@ -14,8 +13,9 @@ permissions:
1413
pages: write
1514
id-token: write
1615

17-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
16+
# Allow only one concurrent deployment, skipping runs queued between the run
17+
# in-progress and latest queued. However, do NOT cancel in-progress runs as we
18+
# want to allow these production deployments to complete.
1919
concurrency:
2020
group: "pages"
2121
cancel-in-progress: false
@@ -28,33 +28,24 @@ jobs:
2828
- name: Checkout repository
2929
uses: actions/checkout@v4.1.7
3030
with:
31+
ref: publish
3132
fetch-depth: 0
3233
ssh-key: ${{ secrets.DEPLOY_KEY }}
3334

3435
- name: Setup Pages
3536
uses: actions/configure-pages@v5
3637

37-
# Each deploy overwrites the contents of `publish` branch from
38-
# `main`, but also introduces a merge structure so that the history of
39-
# `publish` is tracked:
40-
- name: Overwrite publish branch with main branch
38+
- name: Merge `main` to the `publish` branch
4139
run: |
4240
set -x
43-
BASE_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
44-
git config --global user.name 'autodeploy'
45-
git config --global user.email 'autodeploy'
46-
TMP='local-temp-branch'
47-
git checkout -b "$TMP" "$BASE_BRANCH" # Same tree state as main branch
48-
git merge origin/publish \
49-
--commit -m 'Auto-deploy: merging "main" branch'
50-
git checkout publish
51-
git merge --ff-only "$TMP"
52-
git branch -d "$TMP"
41+
git config --global user.name 'github_actions'
42+
git config --global user.email 'actions@github.com'
43+
git merge origin/main --commit -m 'Auto-deploy: merging "main" branch'
5344
5445
- name: Compile ZIPs and Zcash Protocol Specification
5546
uses: ./.github/actions/render
5647

57-
- name: Commit and Push to "publish" branch
48+
- name: Commit and push to `publish` branch
5849
uses: EndBug/add-and-commit@v9.1.4
5950
with:
6051
add: 'rendered'

.github/workflows/render.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Check Renderability
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
render:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v4.1.7
12+
13+
- name: Compile ZIPs and Zcash Protocol Specification
14+
uses: ./.github/actions/render

0 commit comments

Comments
 (0)