Browse Source

修复 action

liuyuqi-dellpc 3 years ago
parent
commit
d97a225d24
4 changed files with 21 additions and 2 deletions
  1. 19 1
      .github/workflows/main.yml
  2. 1 1
      README.md
  3. 0 0
      cmd/refresh.py
  4. 1 0
      requirements.txt

+ 19 - 1
.github/workflows/main.yml

@@ -11,10 +11,28 @@ jobs:
 
     steps:
       - uses: actions/checkout@v2
+        
+      - name: Set up Python 3.8
+        uses: actions/setup-python@v2
+        with:
+          python-version: 3.8
+
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+
+      - uses: actions/cache@v1
+        if: startsWith(runner.os, 'Linux')
+        with:
+          path: ~/.cache/pip
+          key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
+          restore-keys: |
+            ${{ runner.os }}-pip-
 
       - name: Update Deny Host
         run: |
-          python cmd/refreash.py
+          python cmd/refresh.py
 
       - name: Push to built branch
         uses: Automattic/action-commit-to-branch@master

+ 1 - 1
README.md

@@ -20,5 +20,5 @@
 ## 更新黑名单
 
 ```
-python cmd/refreash.py
+python cmd/refresh.py
 ```

+ 0 - 0
cmd/refreash.py → cmd/refresh.py


+ 1 - 0
requirements.txt

@@ -0,0 +1 @@
+requests