diff --git a/.github/workflows/images.yml b/.github/workflows/images.yml index 478d29a..8f940ab 100644 --- a/.github/workflows/images.yml +++ b/.github/workflows/images.yml @@ -42,15 +42,29 @@ jobs: run: | env + # https://help.github.com/en/github/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context - name: Show GitHub variables run: | echo "github.actor: ${{ github.actor }}" echo "github.ref: ${{ github.ref }}" + echo "github.base_ref: ${{ github.base_ref }}" + echo "github.head_ref: ${{ github.head_ref }}" echo "github.event: ${{ github.event }}" echo "github.event_name: ${{ github.event_name }}" echo "github.event.pull_request.base.repo.id: ${{ github.event.pull_request.base.repo.id }}" echo "github.event.pull_request.head.repo.id: ${{ github.event.pull_request.head.repo.id }}" + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "${GITHUB_CONTEXT}" + + - name: Dump Runner context + env: + RUNNER_CONTEXT: ${{ toJson(runner) }} + run: echo "${RUNNER_CONTEXT}" + + build: name: "[ ${{ matrix.version }} ]" runs-on: ubuntu-latest @@ -246,5 +260,29 @@ jobs: # Only run this, if the PR was created by the repo owner - name: Publish images (only repo owner) run: | + # Set branch or tag as slug + if [[ ${GITHUB_REF} =~ ^refs\/tags\/ ]]; then + GIT_TYPE=TAG + GIT_SLUG="${GITHUB_REF/refs\/tags\//}" + else + GIT_TYPE=BRANCH + if [ -n "${GITHUB_HEAD_REF}" ]; then + GIT_SLUG="${GITHUB_HEAD_REF}" + else + GIT_SLUG="${GITHUB_REF/refs\/head\//}" + fi + fi + + echo "Git Type: ${GIT_TYPE}" + echo "Git Slug: ${GIT_SLUG}" + echo "Todo: Push to Dockerhub" - if: (github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id || github.ref == 'refs/heads/master') + # https://help.github.com/en/github/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#functions + if: github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id + && ( + (github.event_name == 'schedule' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))) + || + (github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))) + || + (github.event_name == 'pull_request' && (startsWith(github.head_ref, 'release-'))) + ) diff --git a/README.md b/README.md index 338406b..b287375 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,14 @@ # PHP-FPM Docker images +[](https://github.com/devilbox/docker-php-fpm/actions?workflow=linting) +[](https://github.com/devilbox/docker-php-fpm/actions?workflow=PHP) [](https://travis-ci.org/devilbox/docker-php-fpm) [](https://github.com/devilbox/docker-php-fpm/releases) [](https://gitter.im/devilbox/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](https://devilbox.discourse.group) [](https://opensource.org/licenses/MIT) + This repository will provide you fully functional PHP-FPM Docker images in different flavours, versions and packed with different types of integrated PHP modules. It also solves the problem of **[syncronizing file permissions](#unsynchronized-permissions)** of mounted volumes between the host and the container. @@ -1234,6 +1237,8 @@ $ docker exec -it php mysqldump-secure