mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2025-12-24 02:39:18 -05:00
161 lines
5.3 KiB
YAML
161 lines
5.3 KiB
YAML
name: Jellyseerr CI
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- '*'
|
|
push:
|
|
branches:
|
|
- develop
|
|
|
|
jobs:
|
|
test:
|
|
name: Lint & Test Build
|
|
if: github.event_name == 'pull_request'
|
|
runs-on: ubuntu-24.04
|
|
container: node:22-alpine
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Pnpm Setup
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9
|
|
- name: Get pnpm store directory
|
|
shell: sh
|
|
run: |
|
|
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
|
- name: Setup pnpm cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.STORE_PATH }}
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-store-
|
|
- name: Sanitize Owner and Platform name
|
|
run: |
|
|
echo "OWNER_LC=$(echo '${OWNER}' | tr '[:upper:]' '[:lower:]')" >>${GITHUB_ENV}
|
|
echo "PLATFORM=$(echo '${PLATFORM}' | sed 's|/|-|g')" >>${GITHUB_ENV}
|
|
env:
|
|
OWNER: 'Fallenbagel'
|
|
PLATFORM: 'linux/amd64'
|
|
- name: Test Sanitized Variables
|
|
run: |
|
|
echo "Sanitized Owner: $OWNER_LC"
|
|
echo "Sanitized Platform: $PLATFORM"
|
|
- name: Install dependencies
|
|
env:
|
|
HUSKY: 0
|
|
run: pnpm install
|
|
- name: Lint
|
|
run: pnpm lint
|
|
- name: Formatting
|
|
run: pnpm format:check
|
|
- name: Build
|
|
run: pnpm build
|
|
|
|
build_and_push:
|
|
name: Build & Publish Docker Images
|
|
if: github.ref == 'refs/heads/develop' && !contains(github.event.head_commit.message, '[skip ci]')
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- runner: ubuntu-24.04
|
|
platform: linux/amd64
|
|
- runner: ubuntu-24.04-arm
|
|
platform: linux/arm64
|
|
runs-on: ${{ matrix.runner }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Log in to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_TOKEN }}
|
|
- name: Log in to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Set lower case owner name
|
|
run: |
|
|
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
|
|
env:
|
|
OWNER: ${{ github.repository_owner }}
|
|
- name: Build architecture specific images
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
# platforms: linux/amd64,linux/arm64
|
|
platforms: ${{ matrix.platform }}
|
|
# dont push until merged
|
|
push: false
|
|
build-args: |
|
|
COMMIT_TAG=${{ github.sha }}
|
|
tags: |
|
|
fallenbagel/jellyseerr:develop-${{ matrix.platform == 'linux/amd64' && 'linux-amd64' || 'linux-arm64' }}
|
|
ghcr.io/${{ env.OWNER_LC }}/jellyseerr:develop-${{ matrix.platform == 'linux/amd64' && 'linux-amd64' || 'linux-arm64' }}
|
|
cache-from: type=gha,scope=${{ matrix.platform }}
|
|
cache-to: type=gha,mode=max,scope=${{ matrix.platform }}
|
|
provenance: false
|
|
|
|
create_manifest:
|
|
name: Create Multi-Architecture Image
|
|
needs: build_and_push
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Set lower case owner name
|
|
run: |
|
|
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
|
|
env:
|
|
OWNER: ${{ github.repository_owner }}
|
|
|
|
- name: Create and Push Multi-Architecture Image
|
|
uses: int128/docker-manifest-create-action
|
|
with:
|
|
tags: |
|
|
fallenbagel/jellyseerr:develop
|
|
ghcr.io/${{ github.repository_owner }}/jellyseerr:develop
|
|
sourceas: |
|
|
fallenbagel/jellyseerr:develop-linux-amd64
|
|
fallenbagel/jellyseerr:develop-linux-arm64
|
|
ghcr.io/${{ env.OWNER_LC }}/jellyseerr:develop-linux-amd64
|
|
ghcr.io/${{ env.OWNER_LC }}/jellyseerr:develop-linux-arm64
|
|
- name: Inspect Manifest
|
|
run: |
|
|
docker buildx imagetools inspect fallenbagel/jellyseerr:develop
|
|
docker buildx imagetools inspect ghcr.io/fallenbagel/jellyseerr:develop
|
|
|
|
discord:
|
|
name: Send Discord Notification
|
|
needs: build_and_push
|
|
if: always() && github.event_name != 'pull_request' && !contains(github.event.head_commit.message, '[skip ci]')
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Get Build Job Status
|
|
uses: technote-space/workflow-conclusion-action@v3
|
|
- name: Combine Job Status
|
|
id: status
|
|
run: |
|
|
failures=(neutral, skipped, timed_out, action_required)
|
|
if [[ ${array[@]} =~ $WORKFLOW_CONCLUSION ]]; then
|
|
echo "status=failure" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "status=$WORKFLOW_CONCLUSION" >> $GITHUB_OUTPUT
|
|
fi
|
|
- name: Post Status to Discord
|
|
uses: sarisia/actions-status-discord@v1
|
|
with:
|
|
webhook: ${{ secrets.DISCORD_WEBHOOK }}
|
|
status: ${{ steps.status.outputs.status }}
|
|
title: ${{ github.workflow }}
|
|
nofail: true
|