Skip to content

Commit 9b27c79

Browse files
Initial site skeleton
1 parent 375056b commit 9b27c79

6 files changed

Lines changed: 240 additions & 1 deletion

File tree

.github/workflows/deploy.yml

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
name: Deploy Jekyll site to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
pull-requests: write
15+
16+
concurrency:
17+
group: "pages-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || 'main' }}"
18+
cancel-in-progress: true
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Ruby
28+
uses: ruby/setup-ruby@v1
29+
with:
30+
ruby-version: '3.2'
31+
bundler-cache: true
32+
33+
- name: Setup Pages
34+
id: pages
35+
uses: actions/configure-pages@v4
36+
37+
- name: Build with Jekyll
38+
run: |
39+
if [ "${{ github.event_name }}" == "pull_request" ]; then
40+
# For PRs, build with baseurl pointing to PR-specific folder
41+
bundle exec jekyll build --baseurl "/pr-${{ github.event.pull_request.number }}"
42+
else
43+
# For main branch, build to root
44+
bundle exec jekyll build
45+
fi
46+
env:
47+
JEKYLL_ENV: production
48+
49+
- name: Upload artifact
50+
uses: actions/upload-pages-artifact@v3
51+
with:
52+
path: _site
53+
54+
# Deploy to main domain when merged into main
55+
deploy-main:
56+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
runs-on: ubuntu-latest
61+
needs: build
62+
steps:
63+
- name: Deploy to GitHub Pages
64+
id: deployment
65+
uses: actions/deploy-pages@v4
66+
67+
# Deploy to PR-specific folder on pull requests
68+
deploy-pr:
69+
if: github.event_name == 'pull_request'
70+
runs-on: ubuntu-latest
71+
needs: build
72+
steps:
73+
- name: Checkout gh-pages branch
74+
uses: actions/checkout@v4
75+
with:
76+
ref: gh-pages
77+
token: ${{ secrets.GITHUB_TOKEN }}
78+
79+
- name: Download artifact
80+
uses: actions/download-artifact@v4
81+
with:
82+
name: github-pages
83+
path: ./artifact
84+
85+
- name: Extract artifact
86+
run: |
87+
mkdir -p pr-${{ github.event.pull_request.number }}
88+
tar -xvf ./artifact/artifact.tar -C pr-${{ github.event.pull_request.number }}
89+
90+
- name: Configure Git
91+
run: |
92+
git config user.name "github-actions[bot]"
93+
git config user.email "github-actions[bot]@users.noreply.github.com"
94+
95+
- name: Commit and push PR preview
96+
run: |
97+
git add pr-${{ github.event.pull_request.number }}
98+
git commit -m "Deploy PR #${{ github.event.pull_request.number }} preview" || echo "No changes to commit"
99+
git push origin gh-pages
100+
101+
- name: Comment PR with preview URL
102+
uses: actions/github-script@v7
103+
with:
104+
script: |
105+
const prNumber = context.payload.pull_request.number;
106+
const previewUrl = `https://php-debugger.github.io/pr-${prNumber}/`;
107+
108+
const comment = `## 🚀 Preview Deployment
109+
110+
Your changes have been deployed to a preview environment:
111+
112+
**Preview URL:** ${previewUrl}
113+
114+
This preview will be updated automatically when you push new commits to this PR.`;
115+
116+
// Find existing preview comment
117+
const { data: comments } = await github.rest.issues.listComments({
118+
owner: context.repo.owner,
119+
repo: context.repo.repo,
120+
issue_number: prNumber,
121+
});
122+
123+
const existingComment = comments.find(c =>
124+
c.user.login === 'github-actions[bot]' &&
125+
c.body.includes('Preview Deployment')
126+
);
127+
128+
if (existingComment) {
129+
// Update existing comment
130+
await github.rest.issues.updateComment({
131+
owner: context.repo.owner,
132+
repo: context.repo.repo,
133+
comment_id: existingComment.id,
134+
body: comment
135+
});
136+
} else {
137+
// Create new comment
138+
await github.rest.issues.createComment({
139+
owner: context.repo.owner,
140+
repo: context.repo.repo,
141+
issue_number: prNumber,
142+
body: comment
143+
});
144+
}

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Jekyll
2+
_site/
3+
.sass-cache/
4+
.jekyll-cache/
5+
.jekyll-metadata
6+
vendor/
7+
8+
# Ruby
9+
Gemfile.lock
10+
*.gem
11+
.bundle/
12+
13+
# macOS
14+
.DS_Store
15+
16+
# IDEs
17+
.idea/
18+
.vscode/
19+
*.swp
20+
*.swo
21+
*~

Gemfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
source "https://rubygems.org"
2+
3+
gem "jekyll", "~> 4.3"
4+
gem "minimal-mistakes-jekyll"
5+
6+
group :jekyll_plugins do
7+
gem "jekyll-feed"
8+
gem "jekyll-seo-tag"
9+
gem "jekyll-include-cache"
10+
gem "jekyll-remote-theme"
11+
end
12+
13+
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
14+
platforms :mingw, :x64_mingw, :mswin, :jruby do
15+
gem "tzinfo", ">= 1", "< 3"
16+
gem "tzinfo-data"
17+
end
18+
19+
# Performance-booster for watching directories on Windows
20+
gem "wdm", "~> 0.1", :platforms => [:mingw, :x64_mingw, :mswin]
21+
22+
# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
23+
# do not have a Java counterpart.
24+
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# website
1+
# Website
22
The code behind the public php-debugger.dev website

_config.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Site Settings
2+
title: PHP Debugger
3+
email:
4+
description: >-
5+
A PHP debugger extension focused on step debugging with near-zero overhead.
6+
baseurl: ""
7+
url: "https://php-debugger.github.io"
8+
repository: "php-debugger/php-debugger"
9+
10+
# Build settings
11+
markdown: kramdown
12+
remote_theme: "mmistakes/minimal-mistakes@4.26.2"
13+
14+
# Minimal Mistakes theme settings
15+
minimal_mistakes_skin: "default"
16+
17+
# Site Author
18+
author:
19+
name: "PHP Debugger"
20+
links:
21+
- label: "GitHub"
22+
icon: "fab fa-fw fa-github"
23+
url: "https://github.com/php-debugger/php-debugger"
24+
25+
# Defaults
26+
defaults:
27+
- scope:
28+
path: ""
29+
type: pages
30+
values:
31+
layout: single
32+
author_profile: false
33+
34+
# Plugins
35+
plugins:
36+
- jekyll-feed
37+
- jekyll-seo-tag
38+
- jekyll-include-cache

index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
layout: single
3+
title: "Welcome to PHP Debugger"
4+
---
5+
6+
## About PHP Debugger
7+
8+
A PHP debugger extension focused on step debugging with near-zero overhead. Forked from [Xdebug](https://xdebug.org/), with profiling, coverage, and tracing removed.
9+
10+
### Main Repository
11+
12+
Visit the [PHP Debugger GitHub repository](https://github.com/php-debugger/php-debugger) to get started, view documentation, and contribute to the project.

0 commit comments

Comments
 (0)