add build argument to build script #106
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: 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}"' | |