mirror of
https://github.com/pi-hole/docs.git
synced 2026-04-17 23:53:15 +01:00
CI: add a PYTHON_VERSION environment variable (#297)
This way the pip cache will be invalidate when we change the Python version.
This commit is contained in:
7
.github/workflows/build.yml
vendored
7
.github/workflows/build.yml
vendored
@@ -2,6 +2,7 @@ name: Build and Deploy
|
||||
|
||||
env:
|
||||
CI: true
|
||||
PYTHON_VERSION: '3.7'
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
@@ -16,15 +17,15 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: '3.7'
|
||||
python-version: '${{ env.PYTHON_VERSION }}'
|
||||
architecture: 'x64'
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
key: ${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: ${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/requirements.txt') }}
|
||||
|
||||
- name: Install Python dependencies
|
||||
run: python3 -m pip install -r requirements.txt
|
||||
|
||||
Reference in New Issue
Block a user