Update Releases #149511
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Releases | |
concurrency: update-releases | |
on: | |
schedule: | |
- cron: "*/5 * * * *" | |
workflow_dispatch: | |
push: | |
branches: | |
- source | |
paths: | |
- "mods.json" | |
pull_request: | |
branches: | |
- "source" | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Cache pnpm modules | |
uses: actions/cache@v4 | |
with: | |
path: ~/.pnpm-store | |
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}- | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 8.6.10 | |
run_install: true | |
- name: Build | |
run: | | |
cd scripts | |
pnpm run build | |
- name: Checkout database repo | |
uses: actions/checkout@v4 | |
with: | |
ref: master | |
path: database | |
- name: Make database copy | |
run: cp database/database.json previous-database.json | |
- name: Remove existing thumbnails | |
run: rm -rf database/thumbnails | |
- name: Fetch mod releases and manifests | |
uses: ./actions/update-database | |
with: | |
out-directory: database | |
GITHUB_TOKEN: ${{ env.GH_TOKEN }} | |
mods: mods.json | |
previous-database: previous-database.json | |
google-service-account: ${{ github.event_name != 'pull_request' && secrets.GOOGLE_SERVICE_ACCOUNT || '' }} | |
- name: Upload Pages Artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: database | |
- name: Deploy to GitHub Pages | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: actions/deploy-pages@v4 | |
with: | |
token: ${{ env.GH_TOKEN }} | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
if: ${{ github.event_name != 'pull_request' }} | |
with: | |
branch: master | |
repository: database | |
commit_message: Update mod database | |
commit_user_name: Outer Wilds Mod Database | |
commit_user_email: [email protected] | |
commit_author: Outer Wilds Mod Database <[email protected]> | |
- name: Dispatch Website Build Event | |
if: ${{ github.event_name != 'pull_request' }} | |
run: | | |
curl -XPOST -u "${{ secrets.GH_USER }}:${{ env.GH_TOKEN }}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/ow-mods/outerwildsmods.com/dispatches --data '{"event_type": "build"}' | |
- name: Send Notifications | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: ./actions/send-notifications | |
with: | |
previous-database: previous-database.json | |
next-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 }} |