forked from glpi-project/glpi
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.55 KB
/
branch_build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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/www/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