-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (58 loc) · 2.12 KB
/
main_draft.yml
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
57
58
59
60
61
62
63
64
65
66
67
68
name: Update_List_of_wikis
# Controls when the workflow will run
on:
# # Triggers the workflow on push or pull request events but only for the main branch
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]
schedule:
- cron: '0 0 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
main:
runs-on: ubuntu-latest
env:
OD_USERNAME: '[email protected]'
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
architecture: 'x64'
- name: Python dependences cache
uses: actions/cache@v4
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python requirements
run: |
python -m pip install --upgrade pip
test -f requirements.txt && pip install -r requirements.txt
- name: MS credential cache
id: restore-ms-cache
uses: actions/cache@v4
with:
path: ImgHost/ms_cache.bin.gpg
key: ms-cache-${{ secrets.MS_CACHE_VERSION }}
- name: Decrypt MS credential Cache
if: steps.restore-ms-cache.outputs.cache-hit == 'true'
run: gpg -d --batch -o ImgHost/ms_cache.bin --passphrase ${{ secrets.MS_SECRET }} ImgHost/ms_cache.bin.gpg
- env:
BOT_NAME: ${{ secrets.BOT_NAME }}
BOT_PASS: ${{ secrets.BOT_PASS }}
MS_CLIENT_ID: ${{secrets.MS_CLIENT_ID}}
MS_SECRET: ${{secrets.MS_SECRET}}
RC_IN_SECONDS: 86400
run: python -u ./main.py
- name: Encrypt MS credential Cache
if: steps.restore-ms-cache.outputs.cache-hit != 'true'
run: |
ls -lah ImgHost
test -f ImgHost/ms_cache.bin && gpg -c --batch --passphrase ${{ secrets.MS_SECRET }} ImgHost/ms_cache.bin