From be8b4a1cc3487e424f18819849dc62655bd36f2d Mon Sep 17 00:00:00 2001 From: cruelladevil Date: Wed, 18 Oct 2023 21:45:26 +0900 Subject: [PATCH] =?UTF-8?q?config:=20frontend=20dev=20CD=EC=97=90=20npm=20?= =?UTF-8?q?=EC=BA=90=EC=8B=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/frontend-dev-cd.yml | 33 ++++++++++++++++++++------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/.github/workflows/frontend-dev-cd.yml b/.github/workflows/frontend-dev-cd.yml index 181f1ae36..8c69b1138 100644 --- a/.github/workflows/frontend-dev-cd.yml +++ b/.github/workflows/frontend-dev-cd.yml @@ -11,26 +11,43 @@ jobs: steps: - name: Checkout Source Code - uses: actions/checkout@v2 + uses: actions/checkout@v3 + - name: Setting env shell: bash run: | rm -rf frontend/.env mkdir frontend/.env echo "BASE_URL=${{ secrets.FRONT_DEV_BASE_URL }}" > frontend/.env/.env.production - - name: Package clean install + + - name: Cache dependencies + id: cache-npm + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + path: '**/node_modules' + key: ${{ runner.os }}-node-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-${{ env.cache-name }}- + ${{ runner.os }}-node- + ${{ runner.os }}- + + - name: Install Dependencies shell: bash - run: | - cd frontend - npm ci + if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} + run: npm ci + working-directory: ./frontend + - name: Build files shell: bash - run: | - cd frontend - npm run build + run: npm run build + working-directory: ./frontend + - name: Remove legacy static pages shell: bash run: rm -rf /home/ubuntu/dist + - name: Move generated new static pages shell: bash run: cp -r frontend/dist ~/