Update greader.php #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Push Custom FreshRSS Image | |
| on: | |
| workflow_dispatch: # 允许手动触发 | |
| push: # 监听推送事件 | |
| branches: | |
| - main # 监听 main 分支的推送。 | |
| paths: | |
| - 'greader.php' | |
| - 'FeedDAO.php' # 当 FeedDAO.php 变化时也触发构建 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout patch repository | |
| uses: actions/checkout@v3 | |
| with: | |
| path: patch # 检出您自己的仓库到 'patch' 目录 | |
| - name: Checkout FreshRSS official repository | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: FreshRSS/FreshRSS | |
| path: freshrss-source # 检出官方仓库到 'freshrss-source' 目录 | |
| ref: edge # 明确指定拉取 FreshRSS 仓库的 'edge' 分支 | |
| - name: Apply patches | |
| run: | | |
| echo "Applying custom greader.php..." | |
| # greader.php 路径保持不变 | |
| cp patch/greader.php freshrss-source/p/api/greader.php | |
| echo "greader.php patch applied." | |
| echo "Applying custom FeedDAO.php..." | |
| # --- 核心修正点 --- | |
| # [修正] 使用您确认的正确路径 app/Models/ | |
| cp patch/FeedDAO.php freshrss-source/app/Models/FeedDAO.php | |
| # --- 结束修正 --- | |
| echo "FeedDAO.php patch applied." | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: ./freshrss-source | |
| file: ./freshrss-source/Docker/Dockerfile-Alpine | |
| push: true | |
| tags: aloklok/freshrss-custom:latest # 确保这里是你的 Docker Hub 仓库名 |