Skip to content

Commit c84f966

Browse files
committed
Merge branch 'dev'
2 parents 63eeda2 + 5452a21 commit c84f966

File tree

24 files changed

+731
-524
lines changed

24 files changed

+731
-524
lines changed

.docker/local/Dockerfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM serversideup/php:8.3-fpm-nginx-v3.3.0 AS base
2+
3+
# Set working directory
4+
WORKDIR /var/www/html
5+
6+
# Switch user to root
7+
USER root
8+
9+
# Install required php extensions
10+
RUN install-php-extensions zip intl exif bcmath gd
11+
12+
# ---- Dependencies ----
13+
FROM base AS dependencies
14+
15+
# Install Node.js
16+
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
17+
&& apt-get install -y nodejs
18+
19+
# Install pnpm
20+
RUN npm i -g pnpm
21+
22+
# Copy package.json and pnpm-lock.yaml
23+
COPY . .
24+
25+
RUN rm -rf node_modules
26+
RUN rm pnpm-lock.yaml
27+
28+
# Install node packages
29+
RUN pnpm set progress=false && pnpm config set depth 0
30+
RUN pnpm i
31+
RUN pnpm build
32+
33+
# Install composer packages
34+
RUN composer install
35+
36+
# ---- Release ----
37+
FROM base AS production
38+
39+
# Copy node_modules from dependencies
40+
COPY --from=dependencies /var/www/html/node_modules /var/www/html/node_modules
41+
COPY --from=dependencies /var/www/html/vendor /var/www/html/vendor
42+
COPY --from=dependencies /var/www/html/public/build /var/www/html/public/build
43+
44+
# Switch to www-data user
45+
USER www-data
46+
47+
# Expose port
48+
EXPOSE 8080

.docker/prod/Dockerfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM serversideup/php:8.3-fpm-nginx-v3.3.0 AS base
2+
3+
# Set working directory
4+
WORKDIR /var/www/html
5+
6+
# Switch user to root
7+
USER root
8+
9+
# Install required php extensions
10+
RUN install-php-extensions zip intl exif bcmath gd
11+
12+
# ---- Dependencies ----
13+
FROM base AS dependencies
14+
15+
# Install Node.js
16+
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
17+
&& apt-get install -y nodejs
18+
19+
# Install pnpm
20+
RUN npm i -g pnpm
21+
22+
# Copy package.json and pnpm-lock.yaml
23+
COPY . .
24+
25+
RUN rm -rf node_modules
26+
RUN rm pnpm-lock.yaml
27+
28+
# Install node packages
29+
RUN pnpm set progress=false && pnpm config set depth 0
30+
RUN pnpm i
31+
RUN pnpm build
32+
33+
# Install composer packages
34+
RUN composer install --no-dev --no-scripts --prefer-dist --optimize-autoloader
35+
36+
# ---- Release ----
37+
FROM base AS production
38+
39+
# Copy node_modules from dependencies
40+
COPY --from=dependencies /var/www/html/node_modules /var/www/html/node_modules
41+
COPY --from=dependencies /var/www/html/vendor /var/www/html/vendor
42+
COPY --from=dependencies /var/www/html/public/build /var/www/html/public/build
43+
44+
# Switch to www-data user
45+
USER www-data
46+
47+
# Expose port
48+
EXPOSE 8080

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
vendor
3+
*.log
4+
.dockerignore
5+
.git

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ LOG_LEVEL=debug
1313
LOG_STORE_LAST_X_DAYS=1000
1414

1515
DB_CONNECTION=mysql
16-
DB_HOST=localhost
16+
DB_HOST=ls_dev_db
1717
DB_PORT=3306
1818
DB_DATABASE=laravel_starter
1919
DB_USERNAME=root

.github/workflows/bump.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,28 +73,28 @@ jobs:
7373
- name: 🏗 Build Frontend with Vite
7474
run: pnpm build
7575

76-
- name: Set up Git user
76+
- name: 👤 Set up Git user
7777
run: |
7878
git config --global user.name "${{ github.actor }}-ci-automation"
7979
git config --global user.email "${{ env.GITHUB_GIT_EMAIL }}"
8080
81-
- name: Make changes and commit
81+
- name: 🌿 Create a new branch
8282
run: |
83-
DATE=$(date +'%Y-%m-%d')
84-
BRANCH_NAME="bump/deps-${DATE}"
83+
NEW_BRANCH="update/bump-dependency-versions-$(date +'%d-%m-%Y')"
84+
git checkout -b "$NEW_BRANCH"
8585
86-
git checkout -b "$BRANCH_NAME"
87-
git add .
88-
git commit -m "Automated update on ${DATE}"
86+
- name: 🔍 Check for changes and commit
87+
run: |
88+
git diff --quiet || git commit -am "Update dependencies"
8989
90-
- name: Push changes to a new branch
91-
run: git push origin "$BRANCH_NAME"
90+
- name: 🚀 Push changes
91+
if: success()
92+
run: git push origin "$NEW_BRANCH"
9293

93-
- name: Create a Pull Request
94-
uses: peter-evans/create-pull-request@v5
94+
- name: 🔀 Create Pull Request
95+
uses: repo-sync/pull-request@v2
9596
with:
96-
token: ${{ secrets.GITHUB_TOKEN }}
97-
branch: '$BRANCH_NAME'
98-
base: dev
99-
title: 'Automated Dependency Update on ${DATE}'
100-
body: 'This pull request has been automatically created by GitHub Actions.'
97+
source_branch: ${{ steps.create-branch.outputs.NEW_BRANCH }}
98+
destination_branch: main
99+
pr_title: 'Bump dependencies'
100+
pr_body: 'This PR updates the project dependencies.'

.markdownlint.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"MD013": false,
3+
"MD033": false
4+
}

.scripts/local/bump.bat

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@REM update all packages to the latest minor and patch version
2+
3+
@REM ensure PNPM is installed
4+
CALL pnpm add -g pnpm
5+
6+
@REM check all updates and update them
7+
CALL npx --yes npm-check-updates --packageManager npm --target minor -u
8+
9+
@REM install node dependencies
10+
CALL pnpm i --no-frozen-lockfile
11+
12+
@REM update composer dependencies
13+
CALL composer update

.scripts/local/bump.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# update all packages to the latest minor and patch version
22

3+
# ensure PNPM is installed
4+
pnpm add -g pnpm
5+
36
# check all updates and update them
47
npx --yes npm-check-updates --packageManager pnpm --target minor -u
58

.scripts/local/install.bat

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@REM copy .env.example as .env
2+
CALL copy .env.example .env
3+
14
@REM install PHP packges
25
CALL composer install
36

@@ -8,7 +11,12 @@ CALL php artisan key:generate
811
CALL php artisan storage:link
912

1013
@REM install NPM packges
11-
CALL npm i -s
14+
CALL pnpm i
15+
16+
@REM run docker images
17+
CALL docker compose -f docker-compose-dev.yml up -d
1218

13-
@REM run build scripts
14-
CALL npm run vite:build
19+
@REM setup project
20+
CALL docker exec mb_dev_app composer install
21+
CALL docker exec mb_dev_app php artisan key:generate
22+
CALL docker exec mb_dev_app php artisan migrate:fresh --seed

.scripts/local/install.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# copy .env.example as .env
2+
cp .env.example .env
3+
14
# install PHP packges
25
composer install
36

@@ -8,7 +11,12 @@ php artisan key:generate
811
php artisan storage:link
912

1013
# install NPM packges
11-
npm i -s
14+
pnpm i
15+
16+
# run docker images
17+
docker compose -f docker-compose-dev.yml up -d
1218

13-
# run build script
14-
npm run vite:build
19+
# setup project
20+
docker exec mb_dev_app composer install
21+
docker exec mb_dev_app php artisan key:generate
22+
docker exec mb_dev_app php artisan migrate:fresh --seed

0 commit comments

Comments
 (0)