Skip to content

Commit d5a1747

Browse files
committed
fix(ci): resolve build artifacts path issue in smoke-tests and deploy jobs
- Fix artifacts restoration logic to handle both structures (with/without dist/ prefix) - Add smoke-tests artifact restoration step same as deploy job - Fix race condition where artifacts weren't being properly extracted - This should resolve both smoke-tests and deploy job failures
1 parent 33ac961 commit d5a1747

File tree

1 file changed

+44
-3
lines changed

1 file changed

+44
-3
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,41 @@ jobs:
808808
uses: actions/download-artifact@v6
809809
with:
810810
name: build-artifacts
811-
path: .
811+
path: build-artifacts-temp
812+
813+
- name: Restore build artifacts for smoke tests
814+
run: |
815+
echo "=== Restoring build artifacts for smoke tests ==="
816+
# Check if artifacts are stored directly (without dist/ prefix) or under dist/
817+
if [ -d "build-artifacts-temp/dist" ]; then
818+
echo "✅ Found dist directory in temp artifacts (with dist/ prefix)"
819+
mv build-artifacts-temp/dist ./dist
820+
echo "✅ Moved dist directory to expected location"
821+
elif [ -d "build-artifacts-temp/apps" ]; then
822+
echo "✅ Found apps directory in temp artifacts (without dist/ prefix)"
823+
mv build-artifacts-temp ./dist
824+
echo "✅ Moved temp directory contents to dist/"
825+
else
826+
echo "❌ No valid build artifacts found in temp directory"
827+
echo "=== Contents of temp directory ==="
828+
find build-artifacts-temp -type f -o -type d | head -20
829+
exit 1
830+
fi
831+
832+
# Verify the restored structure
833+
if [ -d "dist/apps/web" ]; then
834+
echo "✅ dist/apps/web directory restored successfully"
835+
find dist/apps/web -maxdepth 1 -type f | head -5
836+
else
837+
echo "❌ dist/apps/web directory not found after restore"
838+
echo "=== Contents of dist directory ==="
839+
find dist -type f -o -type d | head -20
840+
exit 1
841+
fi
842+
843+
# Clean up temp directory
844+
rm -rf build-artifacts-temp
845+
echo "✅ Temporary artifacts directory cleaned up"
812846
813847
- name: Install Playwright browsers
814848
run: pnpm exec playwright install --with-deps chromium
@@ -930,12 +964,17 @@ jobs:
930964
- name: Restore build artifacts
931965
run: |
932966
echo "=== Restoring build artifacts from temp directory ==="
967+
# Check if artifacts are stored directly (without dist/ prefix) or under dist/
933968
if [ -d "build-artifacts-temp/dist" ]; then
934-
echo "✅ Found dist directory in temp artifacts"
969+
echo "✅ Found dist directory in temp artifacts (with dist/ prefix)"
935970
mv build-artifacts-temp/dist ./dist
936971
echo "✅ Moved dist directory to expected location"
972+
elif [ -d "build-artifacts-temp/apps" ]; then
973+
echo "✅ Found apps directory in temp artifacts (without dist/ prefix)"
974+
mv build-artifacts-temp ./dist
975+
echo "✅ Moved temp directory contents to dist/"
937976
else
938-
echo "❌ dist directory not found in temp artifacts"
977+
echo "❌ No valid build artifacts found in temp directory"
939978
echo "=== Contents of temp directory ==="
940979
find build-artifacts-temp -type f -o -type d | head -20
941980
exit 1
@@ -947,6 +986,8 @@ jobs:
947986
find dist/apps/web -maxdepth 1 -type f | head -5
948987
else
949988
echo "❌ dist/apps/web directory not found after restore"
989+
echo "=== Contents of dist directory ==="
990+
find dist -type f -o -type d | head -20
950991
exit 1
951992
fi
952993

0 commit comments

Comments
 (0)