name: Build
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
- name: Install dependencies
run: composer install --no-scripts --no-interaction --prefer-dist
- name: Pest
run: vendor/bin/pest --compact
- name: Build application
run: php class-dependencies-analyzer app:build
- name: Commit and Push changes
env:
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git add -A
git commit -m "Build dependencies for tag $GITHUB_REF" || echo "No changes to commit"
git push https://$PAT_TOKEN@github.com/DeGraciaMathieu/php-class-dependencies-analyzer.git HEAD:refs/heads/main || echo "No changes to push"
|