jellyfin-web/.github/workflows/build.yml

66 lines
1.6 KiB
YAML
Raw Normal View History

2023-09-27 23:22:58 -07:00
name: Build
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
push:
branches: [ master, release* ]
pull_request:
branches: [ master, release* ]
2023-09-27 23:22:58 -07:00
workflow_dispatch:
jobs:
2023-09-27 23:22:58 -07:00
run-build-prod:
name: Run production build
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
2023-11-09 03:04:29 -07:00
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Setup node environment
2023-11-09 03:04:29 -07:00
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version: 20
check-latest: true
cache: npm
- name: Install Node.js dependencies
run: npm ci --no-audit
2023-09-27 23:22:58 -07:00
- name: Run a production build
run: npm run build:production
2023-09-27 23:22:58 -07:00
- name: Upload artifact
2023-11-08 19:50:19 -07:00
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
2023-09-27 23:22:58 -07:00
with:
name: jellyfin-web__prod
path: |
dist
2023-10-09 21:39:31 -07:00
pr_context:
name: Save PR context as artifact
if: ${{ always() && !cancelled() && github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
needs:
- run-build-prod
steps:
- name: Save PR context
env:
PR_NUMBER: ${{ github.event.number }}
PR_SHA: ${{ github.sha }}
run: |
echo $PR_NUMBER > PR_number
echo $PR_SHA > PR_sha
- name: Upload PR number as artifact
2023-11-08 19:50:19 -07:00
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
2023-10-09 21:39:31 -07:00
with:
name: PR_context
path: |
PR_number
PR_sha