Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 📊 Analytics & Monitoring

on:
push:
branches: [ master, main ]
branches: [ main ]
schedule:
# Run daily at 6 AM UTC
- cron: '0 6 * * *'
Expand Down
162 changes: 49 additions & 113 deletions .github/workflows/deploy-ipfs.yml
Original file line number Diff line number Diff line change
@@ -1,113 +1,49 @@
name: Deploy to IPFS

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read
issues: write
deployments: write

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v7

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true

- name: Install dependencies
run: |
gem install bundler
bundle install

- name: Build site
run: bundle exec jekyll build
env:
JEKYLL_ENV: production

# IPFS pinning is best-effort: it must not break the core CI pipeline.
# When PINATA_JWT is absent the steps are skipped; when present but the
# pin fails (expired/invalid token, API error) we log a warning and
# continue so the workflow stays green. The real error is always visible
# in the step log.
- name: Pin to IPFS (best-effort)
id: pinata
if: ${{ secrets.PINATA_JWT != '' }}
continue-on-error: true
env:
PINATA_JWT: ${{ secrets.PINATA_JWT }}
run: |
echo "Attempting to pin ./_site to IPFS via Pinata REST API..."
tar -czf /tmp/site.tar.gz -C _site .
RESP=$(curl -s -X POST "https://api.pinata.cloud/pinning/pinFileToIPFS" \
-H "Authorization: Bearer ${PINATA_JWT}" \
-F "file=@/tmp/site.tar.gz")
CID=$(printf '%s' "$RESP" | grep -oP '(?<=IpfsHash"\s*:\s*")[^"]+')
if [ -z "$CID" ]; then
echo "::warning::IPFS pin failed (check PINATA_JWT / API). Response: $RESP"
echo "cid=" >> "$GITHUB_OUTPUT"
else
echo "cid=$CID" >> "$GITHUB_OUTPUT"
echo "$CID" > ipfs-cid.json
echo "✅ Pinned to IPFS: $CID"
fi

- name: Upload CID artifact
if: ${{ steps.pinata.outputs.cid != '' }}
uses: actions/upload-artifact@v7
with:
name: ipfs-cid
path: ipfs-cid.json

- name: Update DNSLink (if configured)
if: ${{ steps.pinata.outputs.cid != '' && secrets.CLOUDFLARE_API_TOKEN != '' }}
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: |
curl -X PUT "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE_ID }}/dns_records/${{ secrets.CLOUDFLARE_DNS_RECORD_ID }}" \
-H "Authorization: Bearer ${CLOUDFLARE_API_TOKEN}" \
-H "Content-Type: application/json" \
--data "{\"data\":{\"link\":\"/ipfs/${{ steps.pinata.outputs.cid }}\"}}"

- name: Comment PR with IPFS link
if: ${{ github.event_name == 'pull_request' && steps.pinata.outputs.cid != '' }}
uses: actions/github-script@v7
with:
script: |
const cid = '${{ steps.pinata.outputs.cid }}';
const ipfsUrl = `https://gateway.ipfs.io/ipfs/${cid}`;
const previewUrl = `https://${{ secrets.PINATA_GATEWAY || 'gateway.pinata.cloud'}}/ipfs/${cid}`;
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `## 🚀 IPFS Deployment Preview\n\n- **CID**: \`${cid}\`\n- **Public Gateway**: [View on IPFS](${ipfsUrl})\n- **Pinata Gateway**: [View on Pinata](${previewUrl})\n\n✅ Successfully pinned to IPFS!`
});

- name: Create deployment status
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.pinata.outputs.cid != '' }}
uses: actions/github-script@v7
with:
script: |
const cid = '${{ steps.pinata.outputs.cid }}';
const ipfsUrl = `https://gateway.ipfs.io/ipfs/${cid}`;
await github.rest.repos.createDeploymentStatus({
owner: context.repo.owner,
repo: context.repo.repo,
deployment_id: context.payload.deployment?.id || 1,
state: 'success',
environment_url: ipfsUrl,
description: `Deployed to IPFS: ${cid}`,
log_url: `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
environment: 'ipfs-production'
});
# Deploy to IPFS — DISABLED (consolidation phase, 2026-08-15)
#
# Reasons for disabling (see docs/SSG_MIGRATION_PLAN.md + AGENTS.md Decision):
# 1. This workflow runs `bundle exec jekyll build` — the legacy Jekyll stack
# was removed in Phase 7. It would fail (no _config.yml / Gemfile).
# 2. It pinned to Pinata, whose API key/secret/JWT were COMPROMISED on
# 2026-08-14 and must not be used.
# 3. Per the consolidation decision (option b) secret-requiring deploy
# workflows are frozen until an explicit, conscious decision.
#
# If IPFS pinning is wanted later, rebuild this against `hugo --gc --minify`
# (output ./public) and a fresh, non-compromised pinning provider. The last
# working Jekyll state is preserved at git tag `pre-phase7-legacy`.
#
# name: Deploy to IPFS
#
# on:
# push:
# branches: [main]
# pull_request:
# branches: [main]
#
# permissions:
# contents: read
# issues: write
# deployments: write
#
# jobs:
# build-and-deploy:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v7
# - uses: ruby/setup-ruby@v1
# with:
# ruby-version: '3.2'
# bundler-cache: true
# - run: bundle install
# - run: bundle exec jekyll build
# env:
# JEKYLL_ENV: production
# - name: Pin to IPFS (best-effort)
# if: ${{ secrets.PINATA_JWT != '' }}
# continue-on-error: true
# env:
# PINATA_JWT: ${{ secrets.PINATA_JWT }}
# run: |
# tar -czf /tmp/site.tar.gz -C _site .
# curl -s -X POST "https://api.pinata.cloud/pinning/pinFileToIPFS" \
# -H "Authorization: Bearer ${PINATA_JWT}" -F "file=@/tmp/site.tar.gz"
10 changes: 5 additions & 5 deletions .github/workflows/hugo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ jobs:
run: npm ci --prefer-offline --no-audit --no-fund

- name: Validate content contract
# Soft gate: content-contract validates legacy _posts/ against the
# schema; pre-existing posts (e.g. 2015) lack tags/author/permalink and
# fail hard validation. That is legacy state, not a migration error, so
# we surface the report but do NOT block the Hugo build/deploy.
run: node scripts/ci-content-contract.cjs || true
# Publishing contract (Vector A): new posts in content/blog/ MUST
# satisfy schema/post-metadata.schema.json (hard gate — a failing new
# post blocks the build/deploy). Modified legacy posts are report-only.
# Knowledge graph (JSON-LD) is emitted for the whole corpus.
run: node scripts/ci-content-contract.cjs

- name: Build with Hugo
run: hugo --gc --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
Expand Down
115 changes: 52 additions & 63 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: 🔒 Security Scan

on:
push:
branches: [ master, main ]
branches: [ main ]
pull_request:
branches: [ master, main ]
branches: [ main ]
schedule:
# Run weekly on Mondays at 4 AM UTC
- cron: '0 4 * * 1'
Expand All @@ -14,65 +14,54 @@ jobs:
security-scan:
name: 🔒 Security Vulnerability Scan
runs-on: ubuntu-latest

steps:
- name: 📥 Checkout Repository
uses: actions/checkout@v7

- name: 💎 Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
bundler-cache: true

- name: 🟢 Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '24'
cache: 'npm'

- name: 🔍 Node.js Security Audit
run: |
npm audit --audit-level=moderate || true
npm audit --json > npm-audit.json || true

- name: 🔍 Ruby Security Audit
run: |
bundle audit --format=json > ruby-audit.json || true

- name: 🔍 Trivy Vulnerability Scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
format: 'sarif'
output: 'trivy-results.sarif'

- name: 🚨 Semgrep Security Analysis
uses: semgrep/semgrep-action@v1
continue-on-error: true
with:
config: >-
p/security-audit
p/secrets
p/cwe-top-25
generate-sarif: '1'

- name: 📤 Upload Security Reports
uses: actions/upload-artifact@v7
with:
name: security-reports
path: |
npm-audit.json
ruby-audit.json
trivy-results.sarif
semgrep.sarif

- name: 📊 Security Score
run: |
echo "🔒 Security Analysis Summary:"
echo "- Node.js dependencies: ✅ Scanned"
echo "- Ruby dependencies: ✅ Scanned"
echo "- File system vulnerabilities: ✅ Scanned"
echo "- Code security patterns: ✅ Scanned"
echo "- Secrets detection: ✅ Scanned"
- name: 📥 Checkout Repository
uses: actions/checkout@v7

- name: 🟢 Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '24'
cache: 'npm'

- name: 🔍 Node.js Security Audit
run: |
npm audit --audit-level=moderate || true
npm audit --json > npm-audit.json || true

- name: 🔍 Trivy Vulnerability Scanner
# Pinned to a release tag (not @master) per supply-chain policy.
uses: aquasecurity/trivy-action@v0
with:
scan-type: 'fs'
scan-ref: '.'
format: 'sarif'
output: 'trivy-results.sarif'

- name: 🚨 Semgrep Security Analysis
uses: semgrep/semgrep-action@v1
continue-on-error: true
with:
config: >-
p/security-audit
p/secrets
p/cwe-top-25
generate-sarif: '1'

- name: 📤 Upload Security Reports
uses: actions/upload-artifact@v7
with:
name: security-reports
path: |
npm-audit.json
trivy-results.sarif
semgrep.sarif

- name: 📊 Security Score
run: |
echo "🔒 Security Analysis Summary:"
echo "- Node.js dependencies: ✅ Scanned"
echo "- File system vulnerabilities: ✅ Scanned (Trivy)"
echo "- Code security patterns: ✅ Scanned (Semgrep)"
echo "- Secrets detection: ✅ Scanned"
4 changes: 2 additions & 2 deletions .github/workflows/sync_gists.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ jobs:
commit_message: "chore: update gists"
commit_options: '--no-verify'
# Укажите ветку, в которую нужно вносить изменения.
# Обычно это 'main' или 'master'.
branch: master
# Единственная рабочая ветка репозитория — 'main' (master удалён).
branch: main
# Директория, в которой нужно отслеживать изменения.
# Должна совпадать с 'output_dir' из предыдущего шага.
file_pattern: 'gists/*'
Expand Down
Loading
Loading