-
Notifications
You must be signed in to change notification settings - Fork 0
ci(pages): scoped auto-deploy of landing → gh-pages #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| name: Deploy landing → gh-pages | ||
|
|
||
| # Publishes ONLY the landing files (index.html + assets/) from main onto the | ||
| # curated gh-pages branch. | ||
| # | ||
| # gh-pages is hand-assembled, NOT a mirror of main: it carries forge/, forms/, | ||
| # qdrant-features/, docs/, CNAME (memex.quest) and .nojekyll that do NOT exist | ||
| # on main. So this job is deliberately SCOPED — it only overlays index.html and | ||
| # assets/, and never deletes anything else. The "checkout from main" step is | ||
| # additive/update-only, so all curated content survives every deploy. | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - index.html | ||
| - assets/** | ||
| workflow_dispatch: {} | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| # Never run two deploys at once; queue them so a push is never interrupted. | ||
| concurrency: | ||
| group: deploy-landing-gh-pages | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| deploy: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout (all branches, full history) | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Overlay index.html + assets/ onto gh-pages | ||
| run: | | ||
| set -euo pipefail | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
|
|
||
| git switch gh-pages | ||
|
|
||
| # `git checkout <ref> -- <path>` writes ONLY the paths present in that | ||
| # ref's tree and never deletes files that exist solely on gh-pages. | ||
| # That makes this purely additive: forge/, forms/, qdrant-features/, | ||
| # docs/, CNAME and .nojekyll are left exactly as curated. | ||
| git checkout origin/main -- index.html assets | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
On a push that deletes or renames a file under Useful? React with 👍 / 👎. |
||
|
|
||
| git add index.html assets | ||
| if git diff --cached --quiet; then | ||
| echo "Landing already in sync with main — nothing to deploy." | ||
| exit 0 | ||
| fi | ||
|
|
||
| git commit -m "deploy(landing): sync index.html + assets from ${GITHUB_SHA:0:7}" | ||
| git push origin gh-pages | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
액션을 SHA로 고정하여 보안 태세를 개선하세요.
현재
actions/checkout@v4는 변경 가능한 태그를 사용합니다. 공급망 공격을 방지하려면 특정 커밋 SHA로 고정하는 것이 권장됩니다.🔒 SHA 고정 제안
참고: 최신 v4 릴리스의 SHA를 확인하려면 actions/checkout 릴리스를 참조하세요.
🧰 Tools
🪛 zizmor (1.25.2)
[error] 33-33: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
🤖 Prompt for AI Agents