Skip to content

Commit 6bea943

Browse files
committed
✨ Upgrade to PowerMem.ai style dark theme
1 parent 286a28b commit 6bea943

5 files changed

Lines changed: 1122 additions & 87 deletions

File tree

.github/workflows/daily_report.yml

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ jobs:
2828
steps:
2929
- uses: actions/checkout@v4
3030

31+
- name: 📅 Get date
32+
id: date
33+
run: |
34+
echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
35+
echo "year=$(date +%Y)" >> $GITHUB_OUTPUT
36+
echo "month=$(date +%m)" >> $GITHUB_OUTPUT
37+
3138
- name: 🐍 Setup Python
3239
uses: actions/setup-python@v5
3340
with:
@@ -46,24 +53,39 @@ jobs:
4653

4754
- name: 📁 Move output to reports
4855
run: |
49-
DATE=$(date +%Y-%m-%d)
50-
YEAR=$(date +%Y)
51-
MONTH=$(date +%m)
56+
DATE=${{ steps.date.outputs.date }}
57+
YEAR=${{ steps.date.outputs.year }}
58+
MONTH=${{ steps.date.outputs.month }}
5259
mkdir -p reports/$YEAR/$MONTH data/$YEAR/$MONTH
53-
if [ -f output/$DATE.md ]; then
54-
cp output/$DATE.md reports/$YEAR/$MONTH/
55-
fi
56-
if [ -f output/$DATE.json ]; then
57-
cp output/$DATE.json data/$YEAR/$MONTH/
58-
fi
60+
cp output/$DATE.md reports/$YEAR/$MONTH/ 2>/dev/null || true
61+
cp output/$DATE.json data/$YEAR/$MONTH/ 2>/dev/null || true
5962
6063
- name: 📤 Commit and push
6164
run: |
6265
git config user.name "github-actions[bot]"
6366
git config user.email "github-actions[bot]@users.noreply.github.com"
6467
git add reports/ data/
65-
git diff --staged --quiet || git commit -m "📈 Add report for $(date +%Y-%m-%d)"
68+
git diff --staged --quiet || git commit -m "📈 Add report for ${{ steps.date.outputs.date }}"
6669
git push
70+
71+
- name: 📧 Send email notification
72+
if: success()
73+
uses: dawidd6/action-send-mail@v3
74+
with:
75+
server_address: ${{ secrets.MAIL_SERVER }}
76+
server_port: ${{ secrets.MAIL_PORT }}
77+
username: ${{ secrets.MAIL_USERNAME }}
78+
password: ${{ secrets.MAIL_PASSWORD }}
79+
subject: "📈 GitHub Trending 日报 - ${{ steps.date.outputs.date }}"
80+
to: ${{ secrets.MAIL_TO }}
81+
from: GitHub Trending Reporter
82+
html_body: |
83+
<h1>📈 GitHub Trending 日报 - ${{ steps.date.outputs.date }}</h1>
84+
<p>今日报告已生成,点击下方链接查看完整内容:</p>
85+
<p><a href="https://wayyoungboy.github.io/github-trending-reporter/reports/${{ steps.date.outputs.year }}/${{ steps.date.outputs.month }}/${{ steps.date.outputs.date }}">📊 查看在线报告</a></p>
86+
<hr>
87+
<p><small>此邮件由 GitHub Trending Reporter 自动发送</small></p>
88+
attachments: output/${{ steps.date.outputs.date }}.md
6789

6890
# Job 2: 构建部署网站
6991
build-deploy:
@@ -98,6 +120,7 @@ jobs:
98120
with:
99121
path: build
100122

123+
# Job 3: 部署到 GitHub Pages
101124
deploy:
102125
environment:
103126
name: github-pages

docusaurus.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ const config = {
4444
themeConfig:
4545
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
4646
({
47+
colorMode: {
48+
defaultMode: 'dark',
49+
disableSwitch: true,
50+
respectPrefersColorScheme: false,
51+
},
4752
image: 'img/social-card.jpg',
4853
navbar: {
4954
title: 'GitHub Trending Reporter',

0 commit comments

Comments
 (0)