1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-08-22 17:02:58 +02:00

Update deployment flow

This commit is contained in:
Kamran Ahmed
2025-04-05 00:12:50 +01:00
parent 0a42ea6f41
commit 06bdfc42d2
5 changed files with 270 additions and 14 deletions

View File

@@ -2,7 +2,36 @@
set -e
LATEST_COMMIT_HASH=$(git ls-remote git@github.com:roadmapsh/web-draw.git refs/heads/main | awk '{print $1}')
if [ ! -d ".temp/web-draw" ]; then
git clone ssh://git@github.com/roadmapsh/web-draw.git .temp/web-draw --depth 1
fi
echo "Using commit hash: $LATEST_COMMIT_HASH"
pnpm add "github:roadmapsh/web-draw#${LATEST_COMMIT_HASH}&path:packages/editor"
cd .temp/web-draw
pnpm install
npm run build -- --filter=@roadmapsh/editor
# Remove old editor
rm -rf editor
# Copy new editor
cp -rf packages/editor ../../editor
cd ../../
editor_changed_files=$(git ls-files -m editor)
echo $editor_changed_files
# for each of the changed files, assume they are unchanged
for file in $editor_changed_files; do
echo "Assuming $file is unchanged"
git update-index --assume-unchanged $file
done
# Remove temp directory
rm -rf .temp
# Reinstall so that the editor which was setup gets used
pnpm install
git checkout -- pnpm-lock.yaml