Skip to content

Commit edda5bc

Browse files
mergify[bot]yihau
andauthored
v3.0: ci: move docs deploy logic out of build script (backport of #9124) (#9134)
ci: move docs deploy logic out of build script (#9124) (cherry picked from commit 29fa0b0) Co-authored-by: Yihau Chen <[email protected]>
1 parent b22eda2 commit edda5bc

File tree

3 files changed

+57
-16
lines changed

3 files changed

+57
-16
lines changed

.github/workflows/docs.yml

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,12 @@ jobs:
6666
fi
6767
)" >> $GITHUB_OUTPUT
6868
69-
build_and_deploy:
69+
build:
7070
needs:
7171
- check
7272
if: >
7373
github.repository == 'anza-xyz/agave' &&
7474
needs.check.outputs.continue == 1
75-
# the name is used by .mergify.yml as well
76-
name: build & deploy docs
7775
runs-on: ubuntu-22.04
7876
steps:
7977
- name: Checkout
@@ -89,14 +87,49 @@ jobs:
8987
run: |
9088
npm install
9189
./build.sh
90+
91+
- name: Upload artifacts
92+
if: ${{ github.event_name == 'push' }}
93+
uses: actions/upload-artifact@v5
94+
with:
95+
name: docs-build
96+
path: ./docs/build
97+
retention-days: 1
98+
99+
deploy:
100+
needs:
101+
- build
102+
if: >
103+
github.repository == 'anza-xyz/agave' &&
104+
github.event_name == 'push'
105+
runs-on: ubuntu-22.04
106+
steps:
107+
- name: Checkout
108+
uses: actions/checkout@v5
109+
110+
- name: Setup Node
111+
uses: actions/setup-node@v6
112+
with:
113+
node-version: 24
114+
115+
- name: Download artifacts
116+
uses: actions/download-artifact@v6
117+
with:
118+
name: docs-build
119+
path: ./docs/build
120+
121+
- name: Deploy
122+
working-directory: docs
123+
run: ./deploy.sh
92124
env:
93125
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
94126
VERCEL_SCOPE: ${{ secrets.VERCEL_SCOPE }}
95127

96128
error_reporting:
97129
needs:
98130
- check
99-
- build_and_deploy
131+
- build
132+
- deploy
100133
if: failure() && github.event_name == 'push'
101134
uses: ./.github/workflows/error-reporting.yml
102135
secrets:

docs/build.sh

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,3 @@ source ../ci/rust-version.sh
1515
# Build from /src into /build
1616
npm run build
1717
echo $?
18-
19-
# Publish only from merge commits and beta release tags
20-
if [[ -n $CI ]]; then
21-
if [[ -z $CI_PULL_REQUEST ]]; then
22-
eval "$(../ci/channel-info.sh)"
23-
if [[ -n $CI_TAG ]] && [[ $CI_TAG != $BETA_CHANNEL* ]]; then
24-
echo "not a beta tag"
25-
exit 0
26-
fi
27-
./publish-docs.sh
28-
fi
29-
fi

docs/deploy.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
3+
set -eo pipefail
4+
5+
cd "$(dirname "$0")"
6+
7+
# shellcheck source=ci/env.sh
8+
source ../ci/env.sh
9+
10+
# Publish only from merge commits and beta release tags
11+
if [[ -n $CI ]]; then
12+
if [[ -z $CI_PULL_REQUEST ]]; then
13+
eval "$(../ci/channel-info.sh)"
14+
if [[ -n $CI_TAG ]] && [[ $CI_TAG != $BETA_CHANNEL* ]]; then
15+
echo "not a beta tag"
16+
exit 0
17+
fi
18+
./publish-docs.sh
19+
fi
20+
fi

0 commit comments

Comments
 (0)