Skip to content

Commit 9fefe58

Browse files
authored
Only process the tag if publish is true. Remove automatic run on publish.
1 parent b8f69ad commit 9fefe58

1 file changed

Lines changed: 12 additions & 19 deletions

File tree

.github/workflows/apidocs.yml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
name: API Docs
22

33
on:
4-
release:
5-
types: [published]
64
workflow_dispatch:
75
inputs:
86
version_tag:
9-
description: 'Git tag to build docs for (e.g., 3.8.0 or v3.8.0-rc1)'
7+
description: 'Git tag to build docs for (e.g., 1.0.0, 1.0.0-rc1). This is ignored if publish is false.'
108
required: true
11-
smoke_test:
12-
description: 'Run as smoke test (build & artifact only, without pushing to S3)'
9+
publish:
10+
description: 'Publish to S3 (set false for smoke run)'
1311
type: boolean
1412
required: false
1513
default: false
@@ -26,19 +24,13 @@ jobs:
2624
tag: ${{ steps.compute.outputs.tag }}
2725
version: ${{ steps.compute.outputs.version }}
2826
publish: ${{ steps.compute.outputs.publish }}
29-
smoke: ${{ steps.compute.outputs.smoke }}
3027
steps:
3128
- id: compute
32-
name: Compute tag, version, smoke flag
29+
name: Compute tag, version, publish flag
3330
shell: bash
3431
run: |
35-
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
36-
TAG_INPUT="${{ github.event.inputs.version_tag }}"
37-
SMOKE_INPUT="${{ github.event.inputs.smoke_test }}"
38-
else
39-
TAG_INPUT="${{ github.ref_name }}"
40-
SMOKE_INPUT="false"
41-
fi
32+
TAG_INPUT="${{ github.event.inputs.version_tag }}"
33+
PUBLISH_INPUT="${{ github.event.inputs.publish }}"
4234
if [ -z "$TAG_INPUT" ]; then
4335
echo "Tag input is required." >&2
4436
exit 1
@@ -50,8 +42,7 @@ jobs:
5042
VER="${TAG_INPUT#v}"
5143
echo "tag=$TAG_INPUT" >> $GITHUB_OUTPUT
5244
echo "version=$VER" >> $GITHUB_OUTPUT
53-
echo "smoke=$SMOKE_INPUT" >> $GITHUB_OUTPUT
54-
if [ "$SMOKE_INPUT" = "true" ]; then echo "publish=false" >> $GITHUB_OUTPUT; else echo "publish=true" >> $GITHUB_OUTPUT; fi
45+
echo "publish=$PUBLISH_INPUT" >> $GITHUB_OUTPUT
5546
5647
build-docs:
5748
name: Build API Docs
@@ -63,7 +54,12 @@ jobs:
6354
AWS_REGION: us-west-1
6455
S3_BUCKET: docs.couchbase.com
6556
steps:
57+
- name: Checkout repo (smoke)
58+
if: needs.validate-inputs.outputs.publish != 'true'
59+
uses: actions/checkout@v4
60+
6661
- name: Checkout repo at tag
62+
if: needs.validate-inputs.outputs.publish == 'true'
6763
uses: actions/checkout@v4
6864
with:
6965
ref: ${{ needs.validate-inputs.outputs.tag }}
@@ -110,6 +106,3 @@ jobs:
110106
if: needs.validate-inputs.outputs.publish == 'true'
111107
run: |
112108
aws s3 sync "./docs/_site/" "s3://$S3_BUCKET/sdk-api/$API_NAME-$PACKAGE_VERSION/" --acl public-read --delete
113-
114-
115-

0 commit comments

Comments
 (0)