Skip to content

Commit c0b18f3

Browse files
committed
Merge branch 'main' into fix/RevampApiMigration
2 parents a8bc29f + e93d122 commit c0b18f3

File tree

420 files changed

+7017
-4724
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

420 files changed

+7017
-4724
lines changed

.github/workflows/build.yaml

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ name: Build
33
on:
44
push:
55
branches:
6-
- "**"
6+
- main
77
pull_request:
8-
branches:
9-
- "**"
108

119
jobs:
1210
ui:
@@ -29,7 +27,7 @@ jobs:
2927
coverage: none
3028

3129
- name: Install PHP dependencies
32-
run: composer install --no-interaction --no-suggest --prefer-dist
30+
run: composer install --no-interaction --no-suggest --no-progress --no-autoloader --no-scripts --no-dev
3331

3432
- name: Setup Node
3533
uses: actions/setup-node@v4

.github/workflows/ci.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
coverage: none
6767

6868
- name: Install dependencies
69-
run: composer install --no-interaction --no-suggest --prefer-dist
69+
run: composer install --no-interaction --no-suggest --no-progress --no-scripts
7070

7171
- name: Unit tests
7272
run: vendor/bin/pest tests/Unit
@@ -139,7 +139,7 @@ jobs:
139139
coverage: none
140140

141141
- name: Install dependencies
142-
run: composer install --no-interaction --no-suggest --prefer-dist
142+
run: composer install --no-interaction --no-suggest --no-progress --no-scripts
143143

144144
- name: Unit tests
145145
run: vendor/bin/pest tests/Unit
@@ -200,7 +200,7 @@ jobs:
200200
coverage: none
201201

202202
- name: Install dependencies
203-
run: composer install --no-interaction --no-suggest --prefer-dist
203+
run: composer install --no-interaction --no-suggest --no-progress --no-scripts
204204

205205
- name: Create SQLite file
206206
run: touch database/testing.sqlite

.github/workflows/docker-publish.yml

+83-8
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,69 @@ env:
1313
IMAGE_NAME: ${{ github.repository }}
1414

1515
jobs:
16-
build-and-push:
17-
name: Build and Push ${{ matrix.os }}
16+
build-php-base:
17+
name: Build PHP base image on ${{ matrix.os }}
1818
runs-on: ${{ matrix.os }}
1919
permissions:
2020
contents: read
2121
packages: write
22-
2322
strategy:
2423
fail-fast: false
2524
matrix:
26-
os: [ubuntu-24.04, ubuntu-24.04-arm]
25+
include:
26+
- os: ubuntu-24.04
27+
arch: amd64
28+
platform: linux/amd64
29+
- os: ubuntu-24.04-arm
30+
arch: arm64
31+
platform: linux/arm64
32+
steps:
33+
- name: Code checkout
34+
uses: actions/checkout@v4
35+
36+
- name: Setup Docker buildx
37+
uses: docker/setup-buildx-action@v3
38+
39+
- name: Build the base PHP image
40+
uses: docker/build-push-action@v6
41+
with:
42+
context: .
43+
file: ./Dockerfile.base
44+
push: false
45+
load: true
46+
platforms: ${{ matrix.platform }}
47+
tags: base-php:${{ matrix.arch }}
48+
cache-from: type=gha,scope=base-php${{ matrix.arch }}
49+
cache-to: type=gha,scope=base-php${{ matrix.arch }}
50+
51+
- name: Export image to file
52+
run: docker save -o base-php-${{ matrix.arch }}.tar base-php:${{ matrix.arch }}
53+
54+
- name: Push the docker build to the artifacts
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: base-php-${{ matrix.arch }}.tar
58+
path: base-php-${{ matrix.arch }}.tar
59+
retention-days: 7
60+
61+
62+
build-and-push:
63+
name: Build and Push ubuntu-24.04
64+
runs-on: ubuntu-24.04
65+
needs: build-php-base
66+
permissions:
67+
contents: read
68+
packages: write
69+
strategy:
70+
fail-fast: false
71+
# Start a temp local registry because workflow can not pull from localy loaded images
72+
services:
73+
registry:
74+
image: registry:2
75+
ports:
76+
- 5000:5000
2777
# Always run against a tag, even if the commit into the tag has [docker skip] within the commit message.
2878
if: "!contains(github.ref, 'main') || (!contains(github.event.head_commit.message, 'skip docker') && !contains(github.event.head_commit.message, 'docker skip'))"
29-
3079
steps:
3180
- name: Code checkout
3281
uses: actions/checkout@v4
@@ -43,8 +92,14 @@ jobs:
4392
type=ref,event=tag
4493
type=ref,event=branch
4594
95+
- name: Set up QEMU
96+
uses: docker/setup-qemu-action@v3
97+
98+
# We Need to start it in host mode else it can't acces the local registry on port 5000
4699
- name: Setup Docker buildx
47100
uses: docker/setup-buildx-action@v3
101+
with:
102+
driver-opts: network=host
48103

49104
- name: Login to GitHub Container Registry
50105
uses: docker/login-action@v3
@@ -59,29 +114,49 @@ jobs:
59114
echo "version_tag=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT
60115
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
61116
117+
# Download the base PHP image AMD64
118+
- uses: actions/download-artifact@v4
119+
with:
120+
name: base-php-amd64.tar
121+
122+
# Download the base PHP image ARM64
123+
- uses: actions/download-artifact@v4
124+
with:
125+
name: base-php-arm64.tar
126+
127+
- name: Load base images into local registry
128+
run: |
129+
docker load -i base-php-amd64.tar
130+
docker load -i base-php-arm64.tar
131+
docker tag base-php:amd64 localhost:5000/base-php:amd64
132+
docker tag base-php:arm64 localhost:5000/base-php:arm64
133+
docker push localhost:5000/base-php:amd64
134+
docker push localhost:5000/base-php:arm64
135+
rm base-php-arm64.tar base-php-amd64.tar
136+
62137
- name: Build and Push (tag)
63138
uses: docker/build-push-action@v6
64139
if: "github.event_name == 'release' && github.event.action == 'published'"
65140
with:
66141
context: .
67142
file: ./Dockerfile
68143
push: true
69-
platforms: ${{ matrix.os == 'ubuntu-24.04' && 'linux/amd64' || 'linux/arm64' }}
144+
platforms: 'linux/amd64,linux/arm64'
70145
build-args: |
71146
VERSION=${{ steps.build_info.outputs.version_tag }}
72147
labels: ${{ steps.docker_meta.outputs.labels }}
73148
tags: ${{ steps.docker_meta.outputs.tags }}
74149
cache-from: type=gha,scope=tagged${{ matrix.os }}
75150
cache-to: type=gha,scope=tagged${{ matrix.os }},mode=max
76-
151+
77152
- name: Build and Push (main)
78153
uses: docker/build-push-action@v6
79154
if: "github.event_name == 'push' && contains(github.ref, 'main')"
80155
with:
81156
context: .
82157
file: ./Dockerfile
83158
push: ${{ github.event_name != 'pull_request' }}
84-
platforms: ${{ matrix.os == 'ubuntu-24.04' && 'linux/amd64' || 'linux/arm64' }}
159+
platforms: 'linux/amd64,linux/arm64'
85160
build-args: |
86161
VERSION=dev-${{ steps.build_info.outputs.short_sha }}
87162
labels: ${{ steps.docker_meta.outputs.labels }}

.github/workflows/lint.yaml

+21-4
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,38 @@ jobs:
2525
run: cp .env.example .env
2626

2727
- name: Install dependencies
28-
run: composer install --no-interaction --no-progress --prefer-dist
28+
run: composer install --no-interaction --no-suggest --no-progress --no-autoloader --no-scripts
2929

3030
- name: Pint
3131
run: vendor/bin/pint --test
3232
phpstan:
3333
name: PHPStan
3434
runs-on: ubuntu-latest
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
php: [8.2, 8.3, 8.4]
3539
steps:
3640
- name: Code Checkout
3741
uses: actions/checkout@v4
3842

43+
- name: Get cache directory
44+
id: composer-cache
45+
run: |
46+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
47+
48+
- name: Cache
49+
uses: actions/cache@v4
50+
with:
51+
path: ${{ steps.composer-cache.outputs.dir }}
52+
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
53+
restore-keys: |
54+
${{ runner.os }}-composer-${{ matrix.php }}-
55+
3956
- name: Setup PHP
4057
uses: shivammathur/setup-php@v2
4158
with:
42-
php-version: "8.3"
59+
php-version: ${{ matrix.php }}
4360
extensions: bcmath, curl, gd, mbstring, mysql, openssl, pdo, tokenizer, xml, zip
4461
tools: composer:v2
4562
coverage: none
@@ -48,7 +65,7 @@ jobs:
4865
run: cp .env.example .env
4966

5067
- name: Install dependencies
51-
run: composer install --no-interaction --no-progress --prefer-dist
68+
run: composer install --no-interaction --no-suggest --no-progress --no-scripts
5269

5370
- name: PHPStan
54-
run: vendor/bin/phpstan --memory-limit=-1
71+
run: vendor/bin/phpstan --memory-limit=-1

.github/workflows/release.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
coverage: none
2626

2727
- name: Install PHP dependencies
28-
run: composer install --no-interaction --no-suggest --prefer-dist
28+
run: composer install --no-interaction --no-suggest --no-progress --no-autoloader --no-scripts --no-dev
2929

3030
- name: Setup Node
3131
uses: actions/setup-node@v4

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/public/hot
55
/public/storage
66
/storage/*.key
7+
/storage/pail
78
/storage/clockwork/*
89
/vendor
910
*.DS_Store*
@@ -19,6 +20,7 @@ npm-debug.log
1920
yarn-error.log
2021
/.fleet
2122
/.idea
23+
/.nova
2224
/.vscode
2325

2426
public/assets/manifest.json

.php-cs-fixer.dist.php

-52
This file was deleted.

Dockerfile

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
# syntax=docker.io/docker/dockerfile:1.7-labs
1+
# syntax=docker.io/docker/dockerfile:1.13-labs
22
# Pelican Production Dockerfile
33

4-
# ================================
5-
# Stage 1: Build PHP Base Image
6-
# ================================
7-
FROM --platform=$TARGETOS/$TARGETARCH php:8.3-fpm-alpine AS base
84

9-
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
5+
# For those who want to build this Dockerfile themselves, uncomment lines 6-12 and replace "localhost:5000/base-php:$TARGETARCH" on lines 17 and 67 with "base".
6+
7+
# FROM --platform=$TARGETOS/$TARGETARCH php:8.3-fpm-alpine as base
8+
9+
# ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
1010

11-
RUN install-php-extensions bcmath gd intl zip opcache pcntl posix pdo_mysql
11+
# RUN install-php-extensions bcmath gd intl zip opcache pcntl posix pdo_mysql
1212

13-
RUN rm /usr/local/bin/install-php-extensions
13+
# RUN rm /usr/local/bin/install-php-extensions
1414

1515
# ================================
16-
# Stage 2-1: Composer Install
16+
# Stage 1-1: Composer Install
1717
# ================================
18-
FROM --platform=$TARGETOS/$TARGETARCH base AS composer
18+
FROM --platform=$TARGETOS/$TARGETARCH localhost:5000/base-php:$TARGETARCH AS composer
1919

2020
WORKDIR /build
2121

@@ -27,7 +27,7 @@ COPY composer.json composer.lock ./
2727
RUN composer install --no-dev --no-interaction --no-autoloader --no-scripts
2828

2929
# ================================
30-
# Stage 2-2: Yarn Install
30+
# Stage 1-2: Yarn Install
3131
# ================================
3232
FROM --platform=$TARGETOS/$TARGETARCH node:20-alpine AS yarn
3333

@@ -40,7 +40,7 @@ RUN yarn config set network-timeout 300000 \
4040
&& yarn install --frozen-lockfile
4141

4242
# ================================
43-
# Stage 3-1: Composer Optimize
43+
# Stage 2-1: Composer Optimize
4444
# ================================
4545
FROM --platform=$TARGETOS/$TARGETARCH composer AS composerbuild
4646

@@ -50,7 +50,7 @@ COPY --exclude=Caddyfile --exclude=docker/ . ./
5050
RUN composer dump-autoload --optimize
5151

5252
# ================================
53-
# Stage 3-2: Build Frontend Assets
53+
# Stage 2-2: Build Frontend Assets
5454
# ================================
5555
FROM --platform=$TARGETOS/$TARGETARCH yarn AS yarnbuild
5656

@@ -63,9 +63,9 @@ COPY --from=composer /build .
6363
RUN yarn run build
6464

6565
# ================================
66-
# Stage 4: Build Final Application Image
66+
# Stage 5: Build Final Application Image
6767
# ================================
68-
FROM --platform=$TARGETOS/$TARGETARCH base AS final
68+
FROM --platform=$TARGETOS/$TARGETARCH localhost:5000/base-php:$TARGETARCH AS final
6969

7070
WORKDIR /var/www/html
7171

0 commit comments

Comments
 (0)