Skip to content

[add] GitHub action for NorthFlank deployment based on Docker - #111

Merged
TechQuery merged 2 commits into
mainfrom
TechQuery/issue110
Aug 6, 2026
Merged

[add] GitHub action for NorthFlank deployment based on Docker#111
TechQuery merged 2 commits into
mainfrom
TechQuery/issue110

Conversation

@TechQuery

@TechQuery TechQuery commented Aug 6, 2026

Copy link
Copy Markdown
Member

PR-111 PR-111 PR-111 Powered by Pull Request Badge

resolve #110

Summary by CodeRabbit

  • 优化
    • 优化 NGO 页面构建期间的数据获取流程。
    • 保持组织年份范围及页面展示内容不变。

Copilot AI lite review requested due to automatic review settings August 6, 2026 01:43
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • .github/workflows/deploy-Docker.yml is excluded by none and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9fdc00f8-9cc1-48b7-9c13-16debd0a845f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

NGO 页面将 getStaticProps 包装为 skipBuilding 回调。组织年份范围查询和返回的 props 保持不变。

Changes

NGO 页面静态数据获取

Layer / File(s) Summary
包装静态数据获取
pages/NGO/index.tsx
新增 skipBuilding 导入,并包装 getStaticProps 的异步实现。组织模型实例化、年份范围查询和 props 返回逻辑未改变。

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning pages/NGO/index.tsx 的 skipBuilding 改动与 NorthFlank Docker 部署目标无直接关系,属于未说明的额外变更。 移除该无关改动,或在 PR 描述中说明其与 NorthFlank 部署的必要关系。
Linked Issues check ❓ Inconclusive 部署工作流文件被路径过滤排除,无法验证 NorthFlank GitHub Actions 是否实现;可见改动不足以证明需求已满足。 请审查 .github/workflows/deploy-Docker.yml,并确认其按 NorthFlank 文档完成 Docker 部署配置。
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题明确说明基于 Docker 的 NorthFlank GitHub Action 部署,与 PR 目标一致。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch TechQuery/issue110

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3e608e3 and 90d7fc7.

⛔ Files ignored due to path filters (1)
  • .github/workflows/deploy-Docker.yml is excluded by none and included by none
📒 Files selected for processing (1)
  • pages/NGO/index.tsx

Comment thread pages/NGO/index.tsx

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yml to build & push a GHCR image on v* tags and call NorthFlank’s deployment API.
  • Wrap pages/NGO/index.tsx getStaticProps with skipBuilding(...) 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.

Comment thread .github/workflows/deploy-Docker.yml
Comment thread .github/workflows/deploy-Docker.yml Outdated
Comment thread .github/workflows/deploy-Docker.yml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: South Drifter <shiy2008@gmail.com>
Copilot AI review requested due to automatic review settings August 6, 2026 01:48
@TechQuery
TechQuery merged commit 0ed8c4a into main Aug 6, 2026
5 of 6 checks passed
@TechQuery
TechQuery deleted the TechQuery/issue110 branch August 6, 2026 01:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 with jq and pass secrets via env to 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/checkout to a specific commit SHA (or at least a full patch tag like v7.0.1) instead of a floating major tag.
      - uses: actions/checkout@v7

Comment on lines +42 to +46
- uses: docker/build-push-action@v7.2.0
id: push
with:
context: .
push: true
Comment on lines +22 to +26
- name: Inject Environment variables
run: |
cat > .env.local <<EOF
${{ secrets.ENV_FILE }}
EOF
TechQuery added a commit that referenced this pull request Aug 6, 2026
TechQuery added a commit that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Some improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

部署【开源市集】官网到 NorthFlank

2 participants