From fb24483471c6323d5ee8422f6cd46d27899e9b35 Mon Sep 17 00:00:00 2001 From: Donghun Seol Date: Sat, 2 May 2026 08:03:11 +0900 Subject: [PATCH] ci: migrate deploy workflow from GitHub Pages to Cloudflare Pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 워크플로를 Cloudflare Pages 배포로 교체 (cloudflare/wrangler-action@v3) - 불필요한 Dart Sass 설치 제거 (프로젝트는 PostCSS/Tailwind 사용) - Hugo 0.155.3 로 버전 정렬, GitHub Pages용 artifact upload/deploy 단계 제거 - wrangler.toml 추가 (project: seolcoding, output: public) - static/CNAME 삭제 (Cloudflare DNS로 도메인 관리) NOTE: 이 워크플로 동작에 GitHub Secrets 필요 — CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID Co-Authored-By: Claude Opus 4.7 --- .github/workflows/hugo.yml | 39 +++++++++++--------------------------- static/CNAME | 2 -- wrangler.toml | 3 +++ 3 files changed, 14 insertions(+), 30 deletions(-) delete mode 100644 static/CNAME create mode 100644 wrangler.toml diff --git a/.github/workflows/hugo.yml b/.github/workflows/hugo.yml index 06435b8..e0c264d 100644 --- a/.github/workflows/hugo.yml +++ b/.github/workflows/hugo.yml @@ -1,5 +1,5 @@ -# Deploy Hugo site to GitHub Pages -name: Deploy Hugo site to Pages +# Deploy Hugo site to Cloudflare Pages +name: Deploy Hugo site to Cloudflare Pages on: push: @@ -8,8 +8,7 @@ on: permissions: contents: read - pages: write - id-token: write + deployments: write concurrency: group: "pages" @@ -20,19 +19,16 @@ defaults: shell: bash jobs: - build: + deploy: runs-on: ubuntu-latest env: - HUGO_VERSION: 0.152.2 + HUGO_VERSION: 0.155.3 steps: - name: Install Hugo CLI run: | wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ && sudo dpkg -i ${{ runner.temp }}/hugo.deb - - name: Install Dart Sass - run: sudo snap install dart-sass - - name: Checkout uses: actions/checkout@v4 with: @@ -41,10 +37,6 @@ jobs: - name: Init Git submodules run: git submodule update --init --recursive - - name: Setup Pages - id: pages - uses: actions/configure-pages@v5 - - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -68,20 +60,11 @@ jobs: env: HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache HUGO_ENVIRONMENT: production - run: hugo --minify + run: hugo --gc --minify - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + - name: Deploy to Cloudflare Pages + uses: cloudflare/wrangler-action@v3 with: - path: ./public - - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + command: pages deploy public --project-name=seolcoding --branch=main --commit-dirty=true diff --git a/static/CNAME b/static/CNAME deleted file mode 100644 index ad06295..0000000 --- a/static/CNAME +++ /dev/null @@ -1,2 +0,0 @@ -www.seolcoding.com - diff --git a/wrangler.toml b/wrangler.toml new file mode 100644 index 0000000..e69331c --- /dev/null +++ b/wrangler.toml @@ -0,0 +1,3 @@ +name = "seolcoding" +compatibility_date = "2026-04-01" +pages_build_output_dir = "public"