trigger main workflow on pull requests

This commit is contained in:
Raicuparta 2023-03-05 19:48:32 +01:00
parent bc774766f1
commit 050c8db76e
2 changed files with 10 additions and 63 deletions

View File

@ -11,6 +11,9 @@ on:
- source
paths:
- "mods.json"
pull_request:
branches:
- "source"
permissions:
contents: write
@ -64,11 +67,11 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
mods: mods.json
previous-database: database/database.json
discord-mod-hook-urls: ${{ secrets.DISCORD_MOD_HOOK_URLS }}
discord-hook-url: "${{ secrets.DISCORD_HOOK_URL }}"
discord-mod-update-role-id: "${{ secrets.DISCORD_MOD_UPDATE_ROLE_ID }}"
discord-new-mod-role-id: "${{ secrets.DISCORD_NEW_MOD_ROLE_ID }}"
google-service-account: "${{ secrets.GOOGLE_SERVICE_ACCOUNT }}"
discord-mod-hook-urls: ${{ github.event_name != 'pull_request' && secrets.DISCORD_MOD_HOOK_URLS || '' }}
discord-hook-url: ${{ github.event_name != 'pull_request' && secrets.DISCORD_HOOK_URL || '' }}
discord-mod-update-role-id: ${{ github.event_name != 'pull_request' && secrets.DISCORD_MOD_UPDATE_ROLE_ID || '' }}
discord-new-mod-role-id: ${{ github.event_name != 'pull_request' && secrets.DISCORD_NEW_MOD_ROLE_ID || '' }}
google-service-account: ${{ github.event_name != 'pull_request' && secrets.GOOGLE_SERVICE_ACCOUNT || '' }}
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v1
@ -76,12 +79,14 @@ jobs:
path: database
- name: Deploy to GitHub Pages
if: ${{ github.event_name != 'pull_request' }}
uses: actions/deploy-pages@v1
with:
token: ${{ secrets.GH_TOKEN }}
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
if: ${{ github.event_name != 'pull_request' }}
with:
branch: master
repository: database

View File

@ -1,58 +0,0 @@
name: Upload PR artifact
on:
pull_request:
branches:
- "source"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: "16"
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/action-setup@v2
with:
version: 6.23.6
run_install: true
- name: Build
run: |
cd scripts
pnpm run build
- name: Checkout database repo
uses: actions/checkout@v3
with:
ref: master
path: database
- name: Remove existing thumbnails
run: rm -rf database/thumbnails
- name: Fetch mod releases and manifests
uses: ./actions/update-database
with:
out-directory: output
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
mods: mods.json
previous-database: database/database.json
google-service-account: "${{ secrets.GOOGLE_SERVICE_ACCOUNT }}"
- uses: actions/upload-artifact@v3
with:
name: database-preview
path: output