mirror of
https://github.com/LizardByte/GameDB.git
synced 2026-11-10 14:34:41 +09:00
add PR checks
This commit is contained in:
1 file changed
+26
-4
@@ -1,8 +1,14 @@
|
||||
name: Update DB
|
||||
---
|
||||
name: Update
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master, nightly]
|
||||
types: [opened, synchronize, reopened]
|
||||
push:
|
||||
branches: [master, nightly]
|
||||
schedule:
|
||||
- cron: '0 0 * * *' # every day at midnight UTC
|
||||
- cron: '0 0 * * *' # every day at midnight
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
@@ -39,11 +45,11 @@ jobs:
|
||||
run: |
|
||||
# empty contents to ensure deleted igdb are removed
|
||||
rm -f -r ./gh-pages/*
|
||||
|
||||
|
||||
# copy template back to pages
|
||||
cp -f -r ./gh-pages-template/* ./gh-pages/
|
||||
|
||||
- name: Update db
|
||||
- name: Update
|
||||
working-directory: gh-pages
|
||||
run: |
|
||||
python ../update_db.py \
|
||||
@@ -51,7 +57,23 @@ jobs:
|
||||
--twitch_client_secret ${{ secrets.TWITCH_CLIENT_SECRET }} \
|
||||
--youtube_api_key ${{ secrets.YOUTUBE_API_KEY }}
|
||||
|
||||
- name: Prepare Artifacts # uploading artifacts will fail if not zipped due to very large quantity of files
|
||||
shell: bash
|
||||
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
|
||||
run: |
|
||||
7z a "./gh-pages.zip" "gh-pages"
|
||||
|
||||
- name: Upload Artifacts
|
||||
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: gh-pages
|
||||
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
|
||||
path: |
|
||||
${{ github.workspace }}/gh-pages.zip
|
||||
|
||||
- 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
|
||||
uses: actions-js/push@v1.3
|
||||
with:
|
||||
github_token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
|
||||
Reference in new issue
Block a user