-
Notifications
You must be signed in to change notification settings - Fork 3
39 lines (33 loc) · 1.46 KB
/
pornhub.yml
File metadata and controls
39 lines (33 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Pornhub爬取上传缤纷云
on:
schedule:
# 每 7 小时执行一次
# - cron: '0 */7 * * *'
workflow_dispatch: # 允许手动触发工作流
jobs:
crawl_pornhub:
runs-on: ubuntu-22.04 # 使用22.04的 Ubuntu 运行环境
steps:
- name: Checkout code
uses: actions/checkout@v2 # 检出代码
- name: Use Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10.11' # 使用 Python 3.10.11 版本
- name: Install dependencies
run: |
sudo apt-get update # 更新 apt 包列表
sudo apt-get install ffmpeg -y # 安装 ffmpeg
sudo apt-get install -y ca-certificates # 安装根证书
python -m pip install --upgrade pip # 更新 pip
pip install -r requirements.txt # 安装项目依赖
- name: Run Crawler Script
run: |
python main.py # 根据项目结构,运行爬虫脚本
env:
MONGODB_URI: ${{ secrets.MONGODB_URI }} # 从 GitHub Secrets 中获取 MongoDB URI
S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} # 从 GitHub Secrets 中获取 S3 Endpoint
S3_REGION: ${{ secrets.S3_REGION }} # 从 GitHub Secrets 中获取 S3 Region
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} # 从 GitHub Secrets 中获取 S3 Access Key
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }} # 从 GitHub Secrets 中获取 S3 Secret Key
S3_BUCKET: ${{ secrets.S3_BUCKET }} # 从 GitHub Secrets 中获取 S3 Bucket