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"