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

Make deployment script accept pat

This commit is contained in:
Kamran Ahmed
2025-04-04 20:52:20 +01:00
parent deb9aaafc2
commit e72622f2b2
2 changed files with 10 additions and 4 deletions

View File

@@ -3,6 +3,9 @@ name: Deploy to EC2
on:
workflow_dispatch:
env:
GH_PAT: ${{ secrets.GH_PAT }}
jobs:
deploy:
runs-on: ubuntu-latest

View File

@@ -2,10 +2,13 @@
set -e
# Fetch the latest commit hash from the GitHub repo
if [ -n "$GH_PAT" ]; then
LATEST_COMMIT_HASH=$(git ls-remote "https://${GH_PAT}@github.com/roadmapsh/web-draw.git" refs/heads/main | awk '{print $1}')
else
LATEST_COMMIT_HASH=$(git ls-remote git@github.com:roadmapsh/web-draw.git refs/heads/main | awk '{print $1}')
fi
echo "Latest commit hash: $LATEST_COMMIT_HASH"
echo "Using commit hash: $LATEST_COMMIT_HASH"
# Install the package using the latest commit hash
# Install the package using the commit hash
pnpm add github:roadmapsh/web-draw#"$LATEST_COMMIT_HASH"\&path:packages/editor