Files
oneup/.github/workflows/deploy.yml
T

63 lines
1.7 KiB
YAML

name: Build and deploy OneUP
on:
push:
branches: [main, master]
pull_request:
workflow_dispatch:
inputs:
guild:
description: 'Optional full Europe guild name to add to the static analytics data'
required: false
type: string
permissions:
contents: read
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v4
with:
node-version: '24'
- name: Verify content and behavior
run: npm test
- name: Restore published analytics datasets
if: github.event_name != 'pull_request'
uses: actions/cache@v4
with:
path: public/data/intel
key: intel-data-${{ github.run_id }}
restore-keys: intel-data-
- name: Refresh static guild analytics
if: github.event_name != 'pull_request'
run: npm run sync:intel
env:
INTEL_GUILD_NAME: ${{ inputs.guild }}
- name: Download battle preview images
if: github.event_name != 'pull_request'
run: npm run sync:battles
- name: Build static pages
run: npm run build
- uses: actions/upload-pages-artifact@v4
if: github.event_name != 'pull_request'
with:
path: dist
deploy:
if: github.event_name != 'pull_request'
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/configure-pages@v5
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4