From d31d626c61fed1f58602596e805dd181e72f8334 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Sat, 30 Sep 2023 14:23:00 +0100 Subject: [PATCH] Update deployment workflow --- .github/workflows/deploy.yml | 5 +---- scripts/generate-renderer.sh | 10 +++++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d8d0522ce..274e55ad9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,7 +7,6 @@ env: PUBLIC_EDITOR_APP_URL: "https://draw.roadmap.sh" PUBLIC_AVATAR_BASE_URL: "https://dodrc8eu8m09s.cloudfront.net/avatars" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PAT: ${{ secrets.PAT }} CI: true jobs: build: @@ -19,15 +18,13 @@ jobs: - uses: actions/setup-node@v1 with: node-version: 18 - - name: Prepare Draw Repository - run: | - git clone https://${{ secrets.GH_PAT }}@github.com/roadmapsh/web-draw.git .temp/web-draw --depth 1 - uses: pnpm/action-setup@v2.2.2 with: version: 7.13.4 - name: Setup Environment run: | pnpm install + - run: git config --global url."https://${{ secrets.GH_PAT }}@github.com/".insteadOf ssh://git@github.com/ - name: Generate meta and build run: | npm run generate-renderer diff --git a/scripts/generate-renderer.sh b/scripts/generate-renderer.sh index e3cc69522..80f41c92a 100644 --- a/scripts/generate-renderer.sh +++ b/scripts/generate-renderer.sh @@ -2,11 +2,8 @@ set -e -# ignore cloning if .temp/web-draw already exists -if [ ! -d ".temp/web-draw" ]; then - mkdir -p .temp - git clone git@github.com:roadmapsh/web-draw.git .temp/web-draw -fi +rm -rf .temp +git clone git@github.com:roadmapsh/web-draw.git .temp/web-draw rm -rf renderer mkdir renderer @@ -27,5 +24,8 @@ find renderer -type f \( -name "*.ts" -o -name "*.tsx" \) -print0 | while IFS= r fi done +# remove the temporary directory +rm -rf .temp + # ignore the worktree changes for the renderer directory git update-index --skip-worktree renderer/*