[add] GitHub action for NorthFlank deployment based on Docker - #111
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughNGO 页面将 ChangesNGO 页面静态数据获取
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pages/NGO/index.tsx`:
- Around line 10-18: 将 pages/NGO/index.tsx 中的 getStaticProps 改为普通异步静态生成函数,直接执行
OrganizationModel.getYearRange(),让查询失败自然向上抛出而不是经 skipBuilding 转为 notFound;若 CI
确实需要跳过外部数据源,仅在非 CI 分支保留现有错误降级行为。
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 722eafe5-60fe-409a-9e58-ddfa648f93e0
⛔ Files ignored due to path filters (1)
.github/workflows/deploy-Docker.ymlis excluded by none and included by none
📒 Files selected for processing (1)
pages/NGO/index.tsx
There was a problem hiding this comment.
Pull request overview
This PR adds a tag-triggered GitHub Actions workflow to build/push a Docker image to GHCR and trigger a NorthFlank deployment, and adjusts an NGO page to use the existing skipBuilding SSG wrapper (likely to avoid CI-time SSG failures during containerized builds).
Changes:
- Add
.github/workflows/deploy-Docker.ymlto build & push a GHCR image onv*tags and call NorthFlank’s deployment API. - Wrap
pages/NGO/index.tsxgetStaticPropswithskipBuilding(...)for CI-safe static generation behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pages/NGO/index.tsx | Wraps getStaticProps with skipBuilding to avoid CI build-time failures / return fallback when CI is set. |
| .github/workflows/deploy-Docker.yml | New workflow to build/push Docker image to GHCR and trigger NorthFlank deployment on version tags. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: South Drifter <shiy2008@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Suppressed comments (2)
.github/workflows/deploy-Docker.yml:59
- The
curl --data '{..."credentials":"${{ secrets.NORTHFLANK_EXTERNAL_CREDENTIALS }}"...}'JSON is not safely escaped. If the secret contains quotes, newlines, or$characters, the payload can become invalid JSON (or be altered by shell expansion), causing deployments to fail. Build the payload withjqand pass secrets viaenvto avoid quoting/escaping issues.
curl --fail-with-body --show-error --request POST \
--header "Authorization: Bearer ${{ secrets.NORTHFLANK_API_KEY }}" \
--header "Content-Type: application/json" \
--data '{"docker":{"configType":"default"},"external":{"credentials":"${{ secrets.NORTHFLANK_EXTERNAL_CREDENTIALS }}","imagePath":"ghcr.io/${{ github.repository }}:latest"}}' \
https://api.northflank.com/v1/projects/$PROJECT_ID/services/$SERVICE_ID/deployment
.github/workflows/deploy-Docker.yml:20
- For supply-chain safety and reproducible deployments, consider pinning
actions/checkoutto a specific commit SHA (or at least a full patch tag likev7.0.1) instead of a floating major tag.
- uses: actions/checkout@v7
| - uses: docker/build-push-action@v7.2.0 | ||
| id: push | ||
| with: | ||
| context: . | ||
| push: true |
| - name: Inject Environment variables | ||
| run: | | ||
| cat > .env.local <<EOF | ||
| ${{ secrets.ENV_FILE }} | ||
| EOF |
resolve #110
Summary by CodeRabbit