11name : Publish Documentation
22on :
33 push :
4- branches : [main]
4+ # TEMPORARY: Run on all branches for testing
5+ # TODO: Restore to branches: [main] before merging
6+ branches : ['**']
57 workflow_dispatch :
68 inputs :
79 deploy_as_release :
@@ -85,18 +87,20 @@ jobs:
8587 FORCE_DEPLOY="${{ github.event.inputs.force_deploy || false }}"
8688 DEPLOY_AS_RELEASE="${{ github.event.inputs.deploy_as_release || inputs.deploy_as_release }}"
8789
90+ # TEMPORARY: Allow deployment from all branches for testing
91+ # TODO: Restore branch check before merging to main
8892 # Check if we should proceed (default branch, release branch, or force_deploy)
89- if [[ "$IS_DEFAULT_BRANCH" == "false" && "$IS_RELEASE_BRANCH" == "false" && "$FORCE_DEPLOY" == "false" ]]; then
90- echo "Skipping deployment: not on $DEFAULT_BRANCH/release branch and force_deploy not set"
91- echo "To deploy from this branch, set force_deploy=true in workflow_dispatch"
92- echo "deploy_latest=$DEPLOY_LATEST" >> $GITHUB_OUTPUT
93- echo "deploy_major=$DEPLOY_MAJOR" >> $GITHUB_OUTPUT
94- echo "deploy_preview=$DEPLOY_PREVIEW" >> $GITHUB_OUTPUT
95- echo "major_version=$MAJOR_VERSION" >> $GITHUB_OUTPUT
96- echo "version=$VERSION" >> $GITHUB_OUTPUT
97- echo "should_deploy=$SHOULD_DEPLOY" >> $GITHUB_OUTPUT
98- exit 0
99- fi
93+ # if [[ "$IS_DEFAULT_BRANCH" == "false" && "$IS_RELEASE_BRANCH" == "false" && "$FORCE_DEPLOY" == "false" ]]; then
94+ # echo "Skipping deployment: not on $DEFAULT_BRANCH/release branch and force_deploy not set"
95+ # echo "To deploy from this branch, set force_deploy=true in workflow_dispatch"
96+ # echo "deploy_latest=$DEPLOY_LATEST" >> $GITHUB_OUTPUT
97+ # echo "deploy_major=$DEPLOY_MAJOR" >> $GITHUB_OUTPUT
98+ # echo "deploy_preview=$DEPLOY_PREVIEW" >> $GITHUB_OUTPUT
99+ # echo "major_version=$MAJOR_VERSION" >> $GITHUB_OUTPUT
100+ # echo "version=$VERSION" >> $GITHUB_OUTPUT
101+ # echo "should_deploy=$SHOULD_DEPLOY" >> $GITHUB_OUTPUT
102+ # exit 0
103+ # fi
100104
101105 # Validate and extract version info if deploy_as_release is provided
102106 if [[ -n "$DEPLOY_AS_RELEASE" ]]; then
@@ -118,7 +122,9 @@ jobs:
118122 fi
119123
120124 # 1. If on default branch (or force_deploy) and NOT deploying as release, deploy "preview"
121- if [[ ("$IS_DEFAULT_BRANCH" == "true" || "$FORCE_DEPLOY" == "true") && -z "$DEPLOY_AS_RELEASE" ]]; then
125+ # TEMPORARY: Treat all branches as main for testing (but still check NOT deploying as release)
126+ # if [[ ("$IS_DEFAULT_BRANCH" == "true" || "$FORCE_DEPLOY" == "true") && -z "$DEPLOY_AS_RELEASE" ]]; then
127+ if [[ -z "$DEPLOY_AS_RELEASE" ]]; then
122128 DEPLOY_PREVIEW="true"
123129 fi
124130
@@ -128,9 +134,10 @@ jobs:
128134 DEPLOY_MAJOR="true"
129135
130136 # 3. Deploy "latest" only if on default branch (not release branches)
131- if [[ "$IS_DEFAULT_BRANCH" == "true" || "$FORCE_DEPLOY" == "true" ]]; then
132- DEPLOY_LATEST="true"
133- fi
137+ # TEMPORARY: always true for testing
138+ # if [[ "$IS_DEFAULT_BRANCH" == "true" || "$FORCE_DEPLOY" == "true" ]]; then
139+ DEPLOY_LATEST="true"
140+ # fi
134141 fi
135142
136143 # Output results
@@ -200,11 +207,21 @@ jobs:
200207
201208 - name : Update with new version(s)
202209 run : |
210+ # Verify new-docs exists
211+ if [[ ! -d "new-docs" ]]; then
212+ echo "Error: new-docs directory does not exist"
213+ ls -la
214+ exit 1
215+ fi
216+
217+ echo "Contents of new-docs:"
218+ ls -la new-docs/ | head -20
219+
203220 # Function to deploy to a specific version directory
204221 deploy_version() {
205222 local version_dir="$1"
206223 local base_href="$2"
207-
224+
208225 echo "Updating /$version_dir/..."
209226 # Remove old version to ensure clean deployment
210227 rm -rf "deploy-site/$version_dir"
@@ -219,6 +236,8 @@ jobs:
219236 -exec sed -i.bak "s|<head>|<head>\n <base href=\"$base_href\">|" {} \;
220237
221238 find "deploy-site/$version_dir" -name "*.bak" -type f -delete
239+
240+ echo "Deployed to /$version_dir/ ($(du -sh deploy-site/$version_dir | cut -f1))"
222241 }
223242
224243 # Build array of deployments to perform
@@ -237,6 +256,8 @@ jobs:
237256 deployments+=("preview:/preview/")
238257 fi
239258
259+ echo "Deployments to perform: ${deployments[@]}"
260+
240261 # Deploy to each version directory
241262 for deployment in "${deployments[@]}"; do
242263 IFS=':' read -r version_dir base_href <<< "$deployment"
@@ -253,6 +274,9 @@ jobs:
253274 cp -r new-docs/* deploy-site/
254275 fi
255276
277+ echo "Final deploy-site structure:"
278+ ls -la deploy-site/ | head -30
279+
256280 - name : Generate versions.json
257281 run : |
258282 # Check if we have existing versions.json from S3 download
@@ -320,7 +344,7 @@ jobs:
320344 exit 1
321345 fi
322346 aws s3 sync --quiet --no-progress --delete deploy-site/latest/ s3://${{ env.VERSIONED_BUCKET_NAME }}/latest/
323-
347+
324348 echo "Uploading root files and directories..."
325349 # Sync root-level files and directories (excluding version directories)
326350 aws s3 sync --quiet --no-progress \
0 commit comments