Skip to content

Commit 03555ac

Browse files
committed
test(docs): temporairly run as if it was a release
1 parent dbd7e2a commit 03555ac

File tree

2 files changed

+75
-35
lines changed

2 files changed

+75
-35
lines changed

.github/workflows/publish-documentation.yaml

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: Publish Documentation
22
on:
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 \

.github/workflows/release.yaml

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Release
22
on:
3+
# TEMPORARY: Run on all branches for testing
4+
# TODO: Restore to workflow_dispatch only before merging
5+
push:
6+
branches: ['**']
37
workflow_dispatch:
48

59
jobs:
@@ -40,28 +44,40 @@ jobs:
4044
BEFORE_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
4145
echo "before_tag=$BEFORE_TAG" >> $GITHUB_OUTPUT
4246
43-
- run: npx semantic-release
44-
env:
45-
GIT_AUTHOR_NAME: 'Siemens Element Bot'
46-
GIT_AUTHOR_EMAIL: 'simpl.si@siemens.com'
47-
GIT_COMMITTER_NAME: 'Siemens Element Bot'
48-
GIT_COMMITTER_EMAIL: 'simpl.si@siemens.com'
49-
GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_GITHUB_TOKEN }}
50-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
47+
# TEMPORARY: Skip actual release for testing
48+
# TODO: Restore before merging to main
49+
# - run: npx semantic-release
50+
# env:
51+
# GIT_AUTHOR_NAME: 'Siemens Element Bot'
52+
# GIT_AUTHOR_EMAIL: 'simpl.si@siemens.com'
53+
# GIT_COMMITTER_NAME: 'Siemens Element Bot'
54+
# GIT_COMMITTER_EMAIL: 'simpl.si@siemens.com'
55+
# GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_GITHUB_TOKEN }}
56+
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
57+
58+
- name: Simulate release for testing
59+
run: |
60+
echo "Skipping actual semantic-release for testing"
61+
echo "Simulating release v48"
5162
5263
- name: Check if new release was created
5364
id: check_release
5465
run: |
55-
AFTER_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
56-
BEFORE_TAG="${{ steps.before_release.outputs.before_tag }}"
66+
# TEMPORARY: Always simulate v48 release for testing
67+
# TODO: Restore actual tag detection before merging
68+
# AFTER_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
69+
# BEFORE_TAG="${{ steps.before_release.outputs.before_tag }}"
70+
# if [[ -n "$AFTER_TAG" && "$AFTER_TAG" != "$BEFORE_TAG" ]]; then
71+
# echo "release_tag=$AFTER_TAG" >> $GITHUB_OUTPUT
72+
# echo "new_release=true" >> $GITHUB_OUTPUT
73+
# else
74+
# echo "new_release=false" >> $GITHUB_OUTPUT
75+
# echo "release_tag=" >> $GITHUB_OUTPUT
76+
# fi
5777
58-
if [[ -n "$AFTER_TAG" && "$AFTER_TAG" != "$BEFORE_TAG" ]]; then
59-
echo "release_tag=$AFTER_TAG" >> $GITHUB_OUTPUT
60-
echo "new_release=true" >> $GITHUB_OUTPUT
61-
else
62-
echo "new_release=false" >> $GITHUB_OUTPUT
63-
echo "release_tag=" >> $GITHUB_OUTPUT
64-
fi
78+
echo "release_tag=v48.0.0" >> $GITHUB_OUTPUT
79+
echo "new_release=true" >> $GITHUB_OUTPUT
80+
echo "Simulated release: v48.0.0"
6581
6682
trigger-documentation:
6783
uses: ./.github/workflows/publish-documentation.yaml

0 commit comments

Comments
 (0)