From 88dbef739e55eb2b720f247a8f62dbb45a5e2df3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9C=A4=EC=A0=95=EB=AF=BC?= Date: Sat, 11 Nov 2023 17:32:50 +0900 Subject: [PATCH] =?UTF-8?q?feat/#804=20=EB=B9=8C=EB=93=9C=20=ED=83=80?= =?UTF-8?q?=EC=9E=84=EC=9D=84=20=EA=B0=9C=EC=84=A0=ED=95=9C=EB=8B=A4=20(#8?= =?UTF-8?q?05)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: gatsby 빌드 타임 개선 * chore: gatsby v3 이전 버전에서 점진적 빌드를 위한 환경변수 추가 * chore: CircleCI 설정 파일 삭제 --- .circleci/config.yml | 22 --------- .github/workflows/gatsby-build.yml | 73 +++++++++++++++++++++--------- 2 files changed, 52 insertions(+), 43 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 38e508b41..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: 2.1 -jobs: - test: - docker: - - image: circleci/node:12 - steps: - - checkout - - run: - name: npm-install - command: npm ci - - run: - name: lint - command: npm run lint - - run: - name: lint - command: npm run build - -workflows: - version: 2 - test: - jobs: - - test diff --git a/.github/workflows/gatsby-build.yml b/.github/workflows/gatsby-build.yml index 5227efb1f..84b3c52f3 100644 --- a/.github/workflows/gatsby-build.yml +++ b/.github/workflows/gatsby-build.yml @@ -1,31 +1,62 @@ -# This is a basic workflow to help you get started with Actions +name: Deploy Tecoble -name: build gatsby - -# Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the master branch push: - branches: + branches: - main - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - build_gatsby: - name: build - # The type of runner that the job will run on + deploy: + name: Deploy Gatsby Project runs-on: ubuntu-latest + permissions: + contents: write + concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - - uses: enriikke/gatsby-gh-pages-action@v2 + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.4' + cache: npm + + - name: Install Dependencies + run: npm ci + + - name: Cache Gatsby `.cache` Folder + uses: actions/cache@v3 + id: gatsby-cache-folder + with: + path: .cache + key: ${{ runner.os }}-cache-gatsby + restore-keys: ${{ runner.os }}-cache-gatsby + + - if: steps.gatsby-cache-folder.outputs.cache-hit == 'true' + run: echo 'gatsby-cache-folder cache hit!' + + - name: Cache Gatsby `public` Folder + uses: actions/cache@v3 + id: gatsby-public-folder + with: + path: public + key: ${{ runner.os }}-public-gatsby + restore-keys: ${{ runner.os }}-public-gatsby + + - if: steps.gatsby-public-folder.outputs.cache-hit == 'true' + run: echo 'gatsby-public-folder cache hit!' + + - name: Build Gatsby Project + run: npm run build + env: + GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES: true + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 with: - access-token: ${{ secrets.FOR_JAVABLE }} - deploy-branch: gh-pages - gatsby-args: --prefix-paths + github_token: ${{ secrets.FOR_JAVABLE }} + publish_dir: ./public