docs: 간단한 NPM 라이브러리 배포해보기 2탄 CLI 추가 내용 #122
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
name: Pages 배포를 하자. | |
jobs: | |
deploy: | |
name: Pages 배포를 하자. | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18.12.1' | |
cache: yarn | |
- name: Install Dependencies | |
run: yarn install --immutable | |
- 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: | | |
yarn build | |
env: | |
# incremental builds | |
# https://www.gatsbyjs.org/docs/page-build-optimizations-for-incremental-data-changes/ | |
GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES: true | |
- name: 서비스를 Cloudflare pages에 배포해요 | |
uses: cloudflare/[email protected] | |
with: | |
apiToken: ${{ secrets.CF_API_TOKEN }} | |
command: pages publish ./public --project-name=junghyeonsu-dev |