releases/build/deploy-site.ps1
Yun Chan a5a8da7424 feat(growth): ship search registration, long-tail SEO and in-app sharing
Register both Paca domains on Naver Search Advisor, Google Search Console and
Bing Webmaster Tools so the site can be indexed by every major engine, add
DASH and AES-128 how-to pages to capture protocol-specific searches, and let a
finished download share a UTM-tagged landing link from the completion shelf.
Package-manager manifests (winget, Chocolatey, Scoop) now carry verified
v1.2.0 hashes and product codes instead of placeholders. All 2,757 tests pass.

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4.1-flash
2026-09-15 03:37:47 +09:00

34 lines
1.8 KiB
PowerShell

# Paca 사이트(site/)를 Cloudflare Pages 에 배포한다.
# 사용: ./build/deploy-site.ps1 [-Project Paca]
# 필요: .env 의 CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID · node/npx(wrangler)
# 절차: 공개 릴리스 저장소에서 releases.json 생성 → wrangler pages deploy
param([string]$Project = $(if ($env:CF_PAGES_PROJECT) { $env:CF_PAGES_PROJECT } else { "mediabrowser" }))
$ErrorActionPreference = "Stop"
$root = Split-Path -Parent $PSScriptRoot
# .env 로드 (값은 출력하지 않는다)
$envFile = Join-Path $root ".env"
if (-not (Test-Path $envFile)) { throw ".env 가 없습니다. .env.example 을 복사해 채우세요." }
foreach ($line in Get-Content $envFile) {
if ($line -match '^\s*([A-Za-z0-9_]+)\s*=\s*(.+)$') {
$k = $Matches[1]; $v = $Matches[2].Trim()
Set-Item "env:$k" $v
}
}
if (-not $env:CLOUDFLARE_API_TOKEN) { throw ".env 에 CLOUDFLARE_API_TOKEN 이 없습니다." }
if (-not $env:CLOUDFLARE_ACCOUNT_ID) { throw ".env 에 CLOUDFLARE_ACCOUNT_ID 가 없습니다." }
Write-Host "1) releases.json 생성" -ForegroundColor Cyan
node (Join-Path $root "site\fetch-releases.mjs")
if ($LASTEXITCODE -ne 0) { throw "releases.json 생성 실패" }
Write-Host "2) Cloudflare Pages 배포 ($Project)" -ForegroundColor Cyan
npx wrangler pages deploy (Join-Path $root "site") --project-name $Project --branch main --commit-dirty=true
if ($LASTEXITCODE -ne 0) { throw "wrangler 배포 실패" }
Write-Host "완료: https://$Project-7r4.pages.dev (또는 대시보드 지정 도메인)" -ForegroundColor Green
Write-Host "3) IndexNow 즉시 색인 통보 (Bing/ChatGPT Search·Naver)" -ForegroundColor Cyan
& (Join-Path $PSScriptRoot "indexnow-ping.ps1")
if ($LASTEXITCODE -ne 0) { Write-Warning "IndexNow 제출 실패 (배포 자체는 성공, 추후 재실행 가능)" }