2022-06-16 17:27:14 -05:00
|
|
|
name: Publish container
|
2022-06-16 17:25:43 -05:00
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
2022-06-16 17:27:14 -05:00
|
|
|
workflow_dispatch:
|
2022-06-16 19:09:44 -05:00
|
|
|
|
2022-06-16 17:27:14 -05:00
|
|
|
env:
|
|
|
|
REGISTRY: ghcr.io
|
2022-06-16 17:25:43 -05:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2022-06-16 21:23:57 -05:00
|
|
|
permissions:
|
|
|
|
packages: write
|
2022-06-16 17:25:43 -05:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-01-31 03:30:00 -06:00
|
|
|
node-version: [18.x]
|
2022-06-16 19:09:44 -05:00
|
|
|
|
2022-06-16 17:25:43 -05:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2022-10-19 01:37:20 -05:00
|
|
|
|
2022-06-16 21:23:57 -05:00
|
|
|
- name: Login to GHCR
|
2022-11-27 01:49:39 -06:00
|
|
|
uses: docker/login-action@v2.1.0
|
2022-06-16 21:23:57 -05:00
|
|
|
with:
|
|
|
|
registry: ${{ env.REGISTRY }}
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2022-06-16 17:25:43 -05:00
|
|
|
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2022-06-16 19:09:44 -05:00
|
|
|
|
2022-06-16 17:27:14 -05:00
|
|
|
- name: Get npm cache directory
|
|
|
|
id: npm-cache-dir
|
|
|
|
run: |
|
2022-10-19 01:37:20 -05:00
|
|
|
echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
|
2022-06-16 17:27:14 -05:00
|
|
|
|
|
|
|
- name: Configure npm cache
|
|
|
|
uses: actions/cache@v3
|
2022-06-16 21:23:57 -05:00
|
|
|
id: npm-cache
|
2022-06-16 17:27:14 -05:00
|
|
|
with:
|
|
|
|
path: ${{ steps.npm-cache-dir.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-node-
|
2022-06-16 19:09:44 -05:00
|
|
|
|
2022-06-16 17:25:43 -05:00
|
|
|
- name: Checkout modified web interface
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
2022-06-16 17:27:14 -05:00
|
|
|
repository: ConfusedPolarBear/jellyfin-web
|
2022-06-16 17:25:43 -05:00
|
|
|
ref: intros
|
|
|
|
path: web
|
2022-06-16 19:09:44 -05:00
|
|
|
|
2022-06-16 17:27:14 -05:00
|
|
|
- name: Store commit of web interface
|
|
|
|
id: web-commit
|
|
|
|
run: |
|
|
|
|
cd web
|
2022-10-19 01:37:20 -05:00
|
|
|
echo "commit=$(git log -1 --format='%H' | cut -c -10)" >> $GITHUB_OUTPUT
|
2022-06-16 17:25:43 -05:00
|
|
|
|
|
|
|
- name: Build and copy web interface
|
|
|
|
run: |
|
|
|
|
cd web
|
|
|
|
npm install
|
|
|
|
cp -r dist ../docker/
|
2022-06-16 17:27:14 -05:00
|
|
|
tar czf dist.tar.gz dist
|
|
|
|
|
|
|
|
- name: Upload web interface
|
2022-11-27 01:49:39 -06:00
|
|
|
uses: actions/upload-artifact@v3.1.1
|
2022-06-16 17:27:14 -05:00
|
|
|
with:
|
|
|
|
name: jellyfin-web-10.8.0+${{ steps.web-commit.outputs.commit }}.tar.gz
|
|
|
|
path: web/dist.tar.gz
|
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- name: Publish container
|
2022-11-27 01:49:39 -06:00
|
|
|
uses: docker/build-push-action@v3.2.0
|
2022-06-16 17:25:43 -05:00
|
|
|
with:
|
|
|
|
file: docker/Dockerfile
|
|
|
|
context: docker/
|
2022-06-16 17:27:14 -05:00
|
|
|
push: true
|
2022-06-16 21:23:57 -05:00
|
|
|
tags: ${{ env.REGISTRY}}/confusedpolarbear/jellyfin-intro-skipper:${{ steps.web-commit.outputs.commit }}
|