Beta/v1.1.3 #1455
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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-latest | |
| 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-latest | |
| 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/http/dist | |
| build_backend: | |
| name: Build backend | |
| runs-on: ubuntu-latest | |
| 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-latest | |
| 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 | |
| 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/http/embed | |
| cp -r frontend/dist/* backend/http/embed | |
| - name: Set up QEMU | |
| uses: docker/[email protected] | |
| - name: Set up Docker Buildx | |
| uses: docker/[email protected] | |
| - 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-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/[email protected] | |
| - name: Set up Docker Buildx | |
| uses: docker/[email protected] | |
| - 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 |