From a6707636474e7e2ccf20221dd4b709c90b0baf09 Mon Sep 17 00:00:00 2001 From: Aidan Traboulay Date: Fri, 22 Nov 2024 17:37:03 -0400 Subject: [PATCH] revert --- .github/workflows/deploy-preview-frontend.yml | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy-preview-frontend.yml b/.github/workflows/deploy-preview-frontend.yml index ae0e650a..f10a08fa 100644 --- a/.github/workflows/deploy-preview-frontend.yml +++ b/.github/workflows/deploy-preview-frontend.yml @@ -8,20 +8,37 @@ on: jobs: build-and-deploy-frontend: runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: frontend steps: - name: Checkout code uses: actions/checkout@v4 - - name: Install pnpm globally - run: npm install -g pnpm + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + run_install: false - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '20' + cache: 'pnpm' + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + - name: Setup pnpm cache + uses: actions/cache@v3 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- - name: Install dependencies - working-directory: frontend - run: pnpm install + run: pnpm install --frozen-lockfile - name: Build - working-directory: frontend run: pnpm build - name: Deploy to server uses: appleboy/scp-action@master @@ -29,6 +46,6 @@ jobs: host: ${{ secrets.PREVIEW_SERVER_IP }} username: ${{ secrets.PREVIEW_USER }} key: ${{ secrets.PREVIEW_SERVER_SSH_KEY }} - source: "frontend/dist/" + source: "dist/" target: "${{ secrets.TARGET_DIR }}" - strip_components: 2 \ No newline at end of file + strip_components: 1 \ No newline at end of file