mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-19 03:54:13 +02:00
update github workflows
This commit is contained in:
32
.github/workflows/build-push-backend.yml
vendored
32
.github/workflows/build-push-backend.yml
vendored
@@ -15,6 +15,8 @@ on:
|
||||
- 'uv.lock'
|
||||
- '.github/workflows/build-push-backend.yml'
|
||||
- 'tests/**'
|
||||
- 'web/**'
|
||||
|
||||
pull_request:
|
||||
paths:
|
||||
- 'media_manager/**'
|
||||
@@ -25,11 +27,12 @@ on:
|
||||
- 'uv.lock'
|
||||
- '.github/workflows/build-push-backend.yml'
|
||||
- 'tests/**'
|
||||
- 'web/**'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
lint-code:
|
||||
lint-backend:
|
||||
name: Lint Python Code
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -39,8 +42,26 @@ jobs:
|
||||
with:
|
||||
src: "./media_manager"
|
||||
|
||||
lint-frontend:
|
||||
name: Lint Frontend
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: './web/package-lock.json'
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
working-directory: ./web
|
||||
- name: Lint code
|
||||
run: npm run lint
|
||||
working-directory: ./web
|
||||
|
||||
run-tests:
|
||||
needs: lint-code
|
||||
needs: lint-backend
|
||||
name: Run Python Tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -57,7 +78,7 @@ jobs:
|
||||
run: uv run pytest tests
|
||||
|
||||
build-and-push:
|
||||
needs: run-tests
|
||||
needs: [run-tests, lint-frontend]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -84,7 +105,7 @@ jobs:
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/backend
|
||||
images: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/mediamanager
|
||||
tags: |
|
||||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') && github.event_name != 'pull_request' }}
|
||||
type=ref,event=tag
|
||||
@@ -116,3 +137,6 @@ jobs:
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
VERSION=${{ steps.version.outputs.version }}
|
||||
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/mediamanager:buildcache
|
||||
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/mediamanager:buildcache,mode=max
|
||||
|
||||
|
||||
Reference in New Issue
Block a user