GLPI branch build #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "GLPI branch build" | |
on: | |
workflow_dispatch: | |
inputs: | |
php-version: | |
description: "PHP version" | |
required: true | |
default: "8.0" | |
jobs: | |
build: | |
name: "Build GLPI" | |
runs-on: "ubuntu-latest" | |
services: | |
app: | |
image: "ghcr.io/glpi-project/githubactions-php:${{ github.event.inputs.php-version }}" | |
options: >- | |
--volume /glpi:/var/glpi | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
- name: "Deploy source into app container" | |
run: | | |
sudo cp --no-target-directory --preserve --recursive `pwd` /glpi | |
sudo chown -R 1000:1000 /glpi | |
- name: "Install dependencies" | |
run: | | |
docker exec ${{ job.services.app.id }} composer install --optimize-autoloader --prefer-dist --no-interaction --no-progress --no-suggest | |
- name: "Define release name" | |
run: | | |
REF_NAME=$(echo ${{ github.ref_name }} | sed -E 's|/|-|g') | |
SHA=$(git rev-parse --short HEAD) | |
echo "release_name=$REF_NAME.$SHA" >> $GITHUB_ENV | |
- name: "Build" | |
run: | | |
docker exec --interactive ${{ job.services.app.id }} tools/make_release.sh -y . ${{ env.release_name }} | |
docker cp ${{ job.services.app.id }}:/tmp/glpi-${{ env.release_name }}.tgz ${{ github.workspace }}/${{ env.release_name }}.tar.gz | |
- name: "Store archive" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.release_name }}.tar.gz | |
path: ${{ github.workspace }}/${{ env.release_name }}.tar.gz |