Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pulling nightly into master #123

Merged
merged 2 commits into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/update-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
- cron: '0 0 * * *' # every day at midnight
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
update:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -38,7 +42,7 @@ jobs:

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt

- name: Prepare gh-pages
Expand All @@ -52,7 +56,7 @@ jobs:
- name: Update
working-directory: gh-pages
run: |
python ../update.py \
python -u ../update.py \
--discord_invite ${{ secrets.DISCORD_INVITE }} \
--facebook_group_id ${{ secrets.FACEBOOK_GROUP_ID }} \
--facebook_page_id ${{ secrets.FACEBOOK_PAGE_ID }} \
Expand All @@ -69,6 +73,7 @@ jobs:
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
path: |
${{ github.workspace }}/gh-pages
!**/*.git

- name: Deploy to gh-pages
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') || (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') }} # yamllint disable-line rule:line-length
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cloudscraper==1.2.71
Pillow==10.0.0
Pillow==10.0.1
python-dotenv==1.0.0
requests==2.31.0
7 changes: 2 additions & 5 deletions update.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import json
import os
import pathlib
import re

# lib imports
import cloudscraper
Expand Down Expand Up @@ -193,13 +192,11 @@ def update_patreon():
Get patron count from Patreon.
"""
print('Updating Patreon data...')
patreon_url = 'https://www.patreon.com/LizardByte'
patreon_url = 'https://www.patreon.com/api/campaigns/6131567'

response = s.get(url=patreon_url)

data = dict(
patron_count=int(re.search(r'\"patron_count\":\s(\d+)', response.text).group(1))
)
data = response.json()['data']['attributes']

file_path = os.path.join('patreon', 'LizardByte')
write_json_files(file_path=file_path, data=data)
Expand Down
Loading