forked from Turgon37/docker-glpi
-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (44 loc) · 1.77 KB
/
github-actions-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
44
45
46
name: GitHub Actions Build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
glpiversion: [10.0.15]
imagevariant: [nginx-82]
phpxdebug: [yes,no]
steps:
-
name: Git checkout
uses: actions/checkout@v1
-
name: Set environment variables GLPI ${{ matrix.glpiversion }} ${{ matrix.imagevariant }} ${{ matrix.phpxdebug }}
run: |
echo "CI_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
echo "CI_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV
echo "DOCKER_REPO=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
echo "GLPI_VERSION=${{ matrix.glpiversion }}" >> $GITHUB_ENV
echo "IMAGE_VARIANT=${{ matrix.imagevariant }}" >> $GITHUB_ENV
echo "PHP_XDEBUG=${{ matrix.phpxdebug }}" >> $GITHUB_ENV
shell: bash
-
name: Add packages to Linux
run: |
sudo apt update
sudo apt install -y rng-tools coreutils
-
name: Build Docker GLPI ${{ matrix.glpiversion }} ${{ matrix.imagevariant }} ${{ matrix.phpxdebug }}
run: ./build.sh
shell: bash
-
name: Test Docker Containers GLPI ${{ matrix.glpiversion }} ${{ matrix.imagevariant }} ${{ matrix.phpxdebug }}
run: ./tests.sh && touch _test_ok
shell: bash
-
name: Push to Docker Hub GLPI ${{ matrix.glpiversion }} ${{ matrix.imagevariant }} ${{ matrix.phpxdebug }}
run: '[ -n ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} -a -f _test_ok ] && ./publish.sh'
env:
DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
DOCKERHUB_REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_REGISTRY_USERNAME }}
shell: 'script --return --quiet --command "bash {0}"'