-
Notifications
You must be signed in to change notification settings - Fork 200
56 lines (48 loc) · 1.47 KB
/
refresh_token.yml
File metadata and controls
56 lines (48 loc) · 1.47 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Refresh CI Plex Account Token
on:
workflow_dispatch: ~
schedule:
- cron: '52 04 * * *'
env:
CACHE_VERSION: 1
DEFAULT_PYTHON: '3.10'
jobs:
refresh-token:
name: Refresh Token
runs-on: ubuntu-latest
steps:
- name: Check out code from Github
uses: actions/checkout@v6
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v6
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python ${{ steps.python.outputs.python-version }} virtual environment
id: cache-venv
uses: actions/cache@v5
with:
path: venv
key: >-
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{
steps.python.outputs.python-version }}-${{
hashFiles('requirements_dev.txt') }}
restore-keys: >-
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{
steps.python.outputs.python-version }}-
- name: Create Python virtual environment
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
python -m venv venv
. venv/bin/activate
pip install -U pip
pip install -r requirements_dev.txt
pip install -e .
- name: Set Plex credentials
run: |
echo "PLEXAPI_AUTH_SERVER_TOKEN=${{ secrets.PLEXAPI_AUTH_SERVER_TOKEN }}" >> $GITHUB_ENV
- name: Refresh account token
run: |
. venv/bin/activate
python \
-u tools/plex-refreshtoken.py