68 lines
2.0 KiB
YAML
68 lines
2.0 KiB
YAML
name: Build and deploy OneUP
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
inputs:
|
|
refresh_analytics:
|
|
description: 'Refresh analytics by scraping AlbionBB pages (requires source-site access)'
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
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: Restore published analytics datasets
|
|
if: github.event_name == 'workflow_dispatch' && (inputs.refresh_analytics || inputs.guild != '')
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: public/data/intel
|
|
key: intel-data-${{ github.run_id }}-${{ github.run_attempt }}
|
|
restore-keys: intel-data-
|
|
- name: Refresh static guild analytics
|
|
if: github.event_name == 'workflow_dispatch' && (inputs.refresh_analytics || inputs.guild != '')
|
|
run: npm run sync:intel
|
|
env:
|
|
INTEL_GUILD_NAME: ${{ inputs.guild }}
|
|
- name: Verify content and behavior
|
|
run: npm test
|
|
- 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
|