forked from upstream/filebrowser
+10








3c02eedca6
Co-authored-by: Kevin B. <kurami32_kbm@proton.me> Co-authored-by: Gabriel Górski <me@glaeqen.eu> Co-authored-by: Joel Godfrey <82655889+BaccanoMob@users.noreply.github.com> Co-authored-by: Shane Chiu <71911511+pwn2ooown@users.noreply.github.com> Co-authored-by: carloda <35763669+carloda@users.noreply.github.com> Co-authored-by: Taufik Hidayat <taufikdev88@gmail.com> Co-authored-by: Stephan Paternotte <Stephan-P@users.noreply.github.com> Co-authored-by: SIDDHU SINGH <siddhu3116@gmail.com> Co-authored-by: Gaurav Kalal <117557391+Gorupa@users.noreply.github.com> Co-authored-by: Nebula <40148908+nebula-it@users.noreply.github.com> Co-authored-by: Juan Soler <juansoler@gmail.com> Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com> Co-authored-by: Anatolii Prylutskyi <anpryl@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Graham Steffaniak <graham@debian-lake.ghome.net> Co-authored-by: Neil <kylelzzz02@icloud.com> Co-authored-by: Graham <info@quantumx-apps.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
151 lines
4.7 KiB
YAML
151 lines
4.7 KiB
YAML
name: PR Request
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- "main"
|
|
- "dev/v*.*.*"
|
|
- "beta/v*.*.*"
|
|
- "stable/v*.*.*"
|
|
- "staging/v*.*.*"
|
|
jobs:
|
|
prime_docker_cache:
|
|
name: Prime docker cache
|
|
runs-on: ubuntu-24.04-arm
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Prime Cache
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: _docker/Dockerfile.primecache
|
|
push: false
|
|
load: false
|
|
cache-to: |
|
|
type=gha,mode=max,scope=${{ github.ref_name }}-playwright-base
|
|
build_frontend:
|
|
name: Build frontend
|
|
runs-on: ubuntu-24.04-arm
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
- name: Build frontend
|
|
working-directory: frontend
|
|
run: npm i && npm run build
|
|
- name: Upload frontend build artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: dist
|
|
path: backend/internal/web/dist
|
|
build_backend:
|
|
name: Build backend
|
|
runs-on: ubuntu-24.04-arm
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: 'stable'
|
|
- name: Build backend
|
|
working-directory: backend
|
|
run: go build -o filebrowser .
|
|
- name: Upload backend build artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: filebrowser
|
|
path: backend/filebrowser
|
|
test_playwright:
|
|
needs: [build_backend, build_frontend, prime_docker_cache]
|
|
name: Test Playwright - ${{ matrix.name }}
|
|
runs-on: ubuntu-24.04-arm
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: general
|
|
dockerfile: ./_docker/Dockerfile.playwright-general
|
|
- name: proxy
|
|
dockerfile: ./_docker/Dockerfile.playwright-proxy
|
|
- name: noauth
|
|
dockerfile: ./_docker/Dockerfile.playwright-noauth
|
|
- name: oidc
|
|
dockerfile: ./_docker/Dockerfile.playwright-oidc
|
|
- name: sharing
|
|
dockerfile: ./_docker/Dockerfile.playwright-sharing
|
|
- name: no-config
|
|
dockerfile: ./_docker/Dockerfile.playwright-no-config
|
|
- name: settings
|
|
dockerfile: ./_docker/Dockerfile.playwright-settings
|
|
- name: screenshots
|
|
dockerfile: ./_docker/Dockerfile.playwright-screenshots
|
|
- name: previews
|
|
dockerfile: ./_docker/Dockerfile.playwright-previews
|
|
- name: jwt
|
|
dockerfile: ./_docker/Dockerfile.playwright-jwt
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Download frontend build
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: dist
|
|
path: frontend/dist
|
|
- name: Download backend build
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: filebrowser
|
|
path: backend/
|
|
- name: Make backend executable
|
|
run: chmod +x backend/filebrowser
|
|
- name: Copy frontend build to backend
|
|
run: |
|
|
mkdir -p backend/internal/web/embed
|
|
cp -r frontend/dist/* backend/internal/web/embed
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3.0.0
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3.0.0
|
|
- name: Build and Test
|
|
id: build
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ${{ matrix.dockerfile }}
|
|
push: false
|
|
load: true
|
|
cache-from: |
|
|
type=gha,scope=${{ github.ref_name }}-playwright-base
|
|
type=gha,scope=main-playwright-base
|
|
cache-to: |
|
|
type=gha,mode=max,scope=${{ github.ref_name }}-playwright-base
|
|
push_pr_to_registry:
|
|
name: Build docker image
|
|
runs-on: ubuntu-24.04-arm
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3.0.0
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3.0.0
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./_docker/Dockerfile.slim
|
|
push: false # Do not push the image for now
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
build-args: |
|
|
VERSION=${{ steps.meta.outputs.version }}
|
|
REVISION=${{ steps.meta.outputs.revision }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|