1- # Inspired by https://nathan-at-least.github.io/auto-deploy-howto.html
21name : Deploy Rendered Site
32
43on :
@@ -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.
1919concurrency :
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'
0 commit comments