Merge remote-tracking branch 'origin/blog' into blog #299
This file contains hidden or 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
name: Deploy to GitHub Pages | |
on: | |
workflow_dispatch: | |
inputs: | |
importAll: | |
default: false | |
required: false | |
type: boolean | |
description: Enable, if you want to import all TODOs. Runs on checked out branch! Only use if you're sure what you are doing. | |
push: | |
branches: | |
- blog | |
- amp | |
paths-ignore: | |
- /.idea/** | |
jobs: | |
build_site: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
run_install: false | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Get installed Playwright version | |
id: playwright-version | |
run: echo "PLAYWRIGHT_VERSION=$(pnpm list @playwright/test --depth=0 | grep @playwright/test | awk '{print $2}')" >> $GITHUB_ENV | |
- name: Print Playwright version (for debugging) | |
run: echo "Playwright version - ${{env.PLAYWRIGHT_VERSION}}" | |
- name: Cache playwright binaries | |
uses: actions/cache@v4 | |
id: playwright-cache | |
with: | |
path: | | |
~/.cache/ms-playwright | |
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} | |
- run: pnpx playwright install --with-deps chromium | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
- name: build | |
env: | |
BASE_PATH: '/${{ github.event.repository.name }}' | |
run: | | |
pnpm run build | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: blog | |
path: 'build/' # 빌드된 파일의 경로 | |
deploy: | |
needs: build_site | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifact # 아티팩트를 수동으로 다운로드하는 단계 | |
uses: actions/[email protected] | |
with: | |
name: blog # 이전 단계에서 업로드한 아티팩트 이름 | |
path: './build' # 다운로드할 경로 | |
- name: Deploy to Cloudflare Pages with Wrangler # Wrangler 액션 사용 | |
uses: cloudflare/[email protected] # Wrangler 액션 사용 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
command: pages deploy ./build --project-name=${{ github.ref_name }} # 브랜치 이름을 프로젝트 이름으로 사용 |