Skip to content

Commit

Permalink
feat(build): revise workflow & enable caching
Browse files Browse the repository at this point in the history
  • Loading branch information
Fenrikur committed Feb 14, 2025
1 parent aa14fb9 commit 3818fb6
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 68 deletions.
79 changes: 49 additions & 30 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,60 @@ name: Create and publish container image
on:
push:
branches:
- 'main'
- "main"
tags:
- 'v[0-9]+.[0-9]+.[0-9]'
- 'v[0-9]+.[0-9]+.[0-9]-**'
- "v[0-9]+.[0-9]+.[0-9]"
- "v[0-9]+.[0-9]+.[0-9]-**"

jobs:
call_build-and-push-image_nightly:
if: startsWith(github.ref, 'refs/heads/')
build-and-push-image:
if: ${{ startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/') }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
uses: ./.github/workflows/docker-build-push-matrix.yml
with:
image-tags: nightly
secrets:
registry-pass: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/eurofurence/dealer-registration
# generate Docker tags based on the following events/attributes
tags: |
type=schedule,pattern=nightly
type=edge,branch=main
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=sha
call_build-and-push-image_prerelease:
if: ${{ startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-') }}
permissions:
contents: read
packages: write
uses: ./.github/workflows/docker-build-push-matrix.yml
with:
image-tags: ${{ github.ref_name }}
secrets:
registry-pass: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

call_build-and-push-image_release:
if: ${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-') }}
permissions:
contents: read
packages: write
uses: ./.github/workflows/docker-build-push-matrix.yml
with:
image-tags: ${{ github.ref_name }} latest
secrets:
registry-pass: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker BuildX
id: buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host

- name: Build and push
id: docker_build
uses: docker/build-push-action@v6
with:
cache-from: "type=gha"
cache-to: "type=gha,mode=max"
builder: ${{ steps.buildx.outputs.name }}
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
37 changes: 0 additions & 37 deletions .github/workflows/docker-build-push-matrix.yml

This file was deleted.

2 changes: 1 addition & 1 deletion app/Providers/Filament/AdminPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Providers\Filament;

use Filament\Http\Middleware\Authenticate;
use App\Http\Middleware\Authenticate;
use Filament\Http\Middleware\AuthenticateSession;
use Filament\Http\Middleware\DisableBladeIconComponents;
use Filament\Http\Middleware\DispatchServingFilamentEvent;
Expand Down

0 comments on commit 3818fb6

Please sign in to comment.