Skip to content

Merge pull request #9 from jelleroorda/feat/server-and-site-search #13

Merge pull request #9 from jelleroorda/feat/server-and-site-search

Merge pull request #9 from jelleroorda/feat/server-and-site-search #13

Workflow file for this run

name: Build
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get latest tag
id: previoustag
run: |
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "1.3")
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
# Increment minor version
MAJOR=$(echo $LATEST_TAG | cut -d. -f1)
MINOR=$(echo $LATEST_TAG | cut -d. -f2)
NEXT_MINOR=$((MINOR + 1))
NEXT_VERSION="${MAJOR}.${NEXT_MINOR}"
echo "next_version=$NEXT_VERSION" >> $GITHUB_OUTPUT
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite
tools: composer:v2
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Build Laravel Zero app
run: php ploi app:build ploi --build-version=${{ steps.previoustag.outputs.next_version }}
- name: Configure Git
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Commit build
run: |
git add builds/ploi
git commit -m "Update application build to version ${{ steps.previoustag.outputs.next_version }} [skip ci]" || echo "No changes to commit"
git tag -a "${{ steps.previoustag.outputs.next_version }}" -m "Version ${{ steps.previoustag.outputs.next_version }}"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
tags: true