diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 05c01da..2cfd4b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,28 +13,60 @@ on: # Runs on Push push: +env: + MATRIX_VERSION: '["8.2"]' + MATRIX_ARCH: '["linux/amd64","linux/386","linux/arm64","linux/arm/v7","linux/arm/v6"]' + jobs: # ----------------------------------------------------------------------------------------------- - # Job (1/2): BUILD + # Job (1/3): Configure Pipeline + # ----------------------------------------------------------------------------------------------- + configure: + name: Configure + runs-on: ubuntu-latest + outputs: + matrix_version: ${{ steps.set-matrix-version.outputs.matrix_version }} + matrix_arch: ${{ steps.set-matrix-arch.outputs.matrix_arch }} + manifest_arch: ${{ steps.set-manifest-arch.outputs.manifest }} + steps: + + - name: "[OUTPUT] Export Matrix 'Version'" + id: set-matrix-version + run: | + echo '::set-output name=matrix_version::${{ env.MATRIX_VERSION }}' + echo "${{ env.MATRIX_VERSION }}" + + - name: "[OUTPUT] Export Matrix 'Arch'" + id: set-matrix-arch + run: | + echo '::set-output name=matrix_arch::${{ env.MATRIX_ARCH }}' + echo "${{ env.MATRIX_ARCH }}" + + - name: "[OUTPUT] Export Manifest 'Arch'" + id: set-manifest-arch + run: | + ARCH="$( echo ${{ env.MATRIX_ARCH }} | sed 's/"//g' | sed 's/\[//g' | sed 's/\]//g' | sed 's/ //g' )" + echo "::set-output name=manifest::${ARCH}" + echo "${ARCH}" + + + # ----------------------------------------------------------------------------------------------- + # Job (2/3): BUILD # ----------------------------------------------------------------------------------------------- build: - name: "[ PHP-${{ matrix.version }} (${{ matrix.arch }}) ]" + needs: configure + name: Build PHP-${{ matrix.version }} (${{ matrix.arch }}) runs-on: ubuntu-latest strategy: fail-fast: false matrix: version: - - '8.2' + - ${{ fromJson(needs.configure.outputs.matrix_version) }} arch: - - 'linux/amd64' - - 'linux/arm64' - - 'linux/386' - - 'linux/arm/v7' - - 'linux/arm/v6' + - ${{ fromJson(needs.configure.outputs.matrix_arch) }} steps: - # ------------------------------------------------------------ # Setup repository # ------------------------------------------------------------ @@ -51,37 +83,31 @@ jobs: - name: "[SETUP] Determine Docker tag" id: tag - uses: cytopia/docker-tag@v0.3 + uses: cytopia/docker-tag-action@v0.4.7 # ------------------------------------------------------------ # Build # ------------------------------------------------------------ - name: Build - uses: cytopia/shell-command-retry-action@v0.1 + uses: cytopia/shell-command-retry-action@v0.1.2 with: command: | - make build ARCH=${ARCH} - env: - ARCH: ${{ matrix.arch }} + make build ARCH=${{ matrix.arch }} # ------------------------------------------------------------ # Test # ------------------------------------------------------------ - name: "[TEST] Docker Image" - uses: cytopia/shell-command-retry-action@v0.1 + uses: cytopia/shell-command-retry-action@v0.1.2 with: command: | - make test ARCH=${ARCH} - env: - ARCH: ${{ matrix.arch }} + make test ARCH=${{ matrix.arch }} - name: "[TEST] Update README" - uses: cytopia/shell-command-retry-action@v0.1 + uses: cytopia/shell-command-retry-action@v0.1.2 with: command: | - make update-readme ARCH=${ARCH} - env: - ARCH: ${{ matrix.arch }} + make update-readme ARCH=${{ matrix.arch }} - name: "[TEST] Verify README" run: | @@ -90,19 +116,26 @@ jobs: # ------------------------------------------------------------ # Deploy # ------------------------------------------------------------ - - name: "[DEPLOY] Login" + - name: "[DEPLOY] Login (only repo owner)" uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} + # 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 == 'push' && startsWith(github.ref, 'refs/heads/release-')) + ) - name: "[DEPLOY] Publish architecture image (only repo owner)" - uses: cytopia/shell-command-retry-action@v0.1 + uses: cytopia/shell-command-retry-action@v0.1.2 with: command: | - make push-arch TAG=${{ steps.tag.outputs.docker-tag }} ARCH=${ARCH} - env: - ARCH: ${{ matrix.arch }} + make push-arch TAG=${{ steps.tag.outputs.docker-tag }} ARCH=${{ matrix.arch }} # 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 && ( @@ -114,19 +147,27 @@ jobs: ) # ----------------------------------------------------------------------------------------------- - # Job (2/2): DEPLOY + # Job (3/3): DEPLOY # ----------------------------------------------------------------------------------------------- deploy: - needs: [build] + needs: [configure, build] name: Deploy runs-on: ubuntu-latest strategy: fail-fast: false matrix: version: - - '8.2' + - ${{ fromJson(needs.configure.outputs.matrix_version) }} + # 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 == 'push' && startsWith(github.ref, 'refs/heads/release-')) + ) steps: - # ------------------------------------------------------------ # Setup repository # ------------------------------------------------------------ @@ -137,7 +178,7 @@ jobs: - name: "[SETUP] Determine Docker tag" id: tag - uses: cytopia/docker-tag@v0.3 + uses: cytopia/docker-tag-action@v0.4.7 # ------------------------------------------------------------ # Deploy @@ -149,22 +190,13 @@ jobs: password: ${{ secrets.DOCKERHUB_PASSWORD }} - name: "[DEPLOY] Create Docker manifest" - uses: cytopia/shell-command-retry-action@v0.1 + uses: cytopia/shell-command-retry-action@v0.1.2 with: command: | - make manifest-create TAG=${{ steps.tag.outputs.docker-tag }} ARCH="linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6" + make manifest-create TAG=${{ steps.tag.outputs.docker-tag }} ARCH="${{ needs.configure.outputs.manifest_arch }}" - - name: "[DEPLOY] Publish Docker manifest (only repo owner)" - uses: cytopia/shell-command-retry-action@v0.1 + - name: "[DEPLOY] Publish Docker manifest" + uses: cytopia/shell-command-retry-action@v0.1.2 with: command: | make manifest-push TAG=${{ steps.tag.outputs.docker-tag }} - # 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 == 'push' && startsWith(github.ref, 'refs/heads/release-')) - ) diff --git a/.github/workflows/contributor.yml b/.github/workflows/contributor.yml index 2570bfa..d09144c 100644 --- a/.github/workflows/contributor.yml +++ b/.github/workflows/contributor.yml @@ -13,30 +13,64 @@ on: # Runs on Pull Requests pull_request: +env: + MATRIX_VERSION: '["8.2"]' + MATRIX_ARCH: '["linux/amd64","linux/386","linux/arm64","linux/arm/v7","linux/arm/v6"]' + jobs: # ----------------------------------------------------------------------------------------------- - # Job (1/2): BUILD + # Job (1/3): Configure Pipeline + # ----------------------------------------------------------------------------------------------- + configure: + name: Configure + runs-on: ubuntu-latest + outputs: + matrix_version: ${{ steps.set-matrix-version.outputs.matrix_version }} + matrix_arch: ${{ steps.set-matrix-arch.outputs.matrix_arch }} + manifest_arch: ${{ steps.set-manifest-arch.outputs.manifest }} + # Only run for forks (contributor) + if: ${{ github.event.pull_request.head.repo.fork }} + steps: + + - name: "[OUTPUT] Export Matrix 'Version'" + id: set-matrix-version + run: | + echo '::set-output name=matrix_version::${{ env.MATRIX_VERSION }}' + echo "${{ env.MATRIX_VERSION }}" + + - name: "[OUTPUT] Export Matrix 'Arch'" + id: set-matrix-arch + run: | + echo '::set-output name=matrix_arch::${{ env.MATRIX_ARCH }}' + echo "${{ env.MATRIX_ARCH }}" + + - name: "[OUTPUT] Export Manifest 'Arch'" + id: set-manifest-arch + run: | + ARCH="$( echo ${{ env.MATRIX_ARCH }} | sed 's/"//g' | sed 's/\[//g' | sed 's/\]//g' | sed 's/ //g' )" + echo "::set-output name=manifest::${ARCH}" + echo "${ARCH}" + + + # ----------------------------------------------------------------------------------------------- + # Job (2/3): BUILD # ----------------------------------------------------------------------------------------------- build: - name: "[ PHP-${{ matrix.version }} (${{ matrix.arch }}) ]" + needs: configure + name: Build PHP-${{ matrix.version }} (${{ matrix.arch }}) runs-on: ubuntu-latest strategy: fail-fast: false matrix: version: - - '8.2' + - ${{ fromJson(needs.configure.outputs.matrix_version) }} arch: - - 'linux/amd64' - - 'linux/arm64' - - 'linux/386' - - 'linux/arm/v7' - - 'linux/arm/v6' + - ${{ fromJson(needs.configure.outputs.matrix_arch) }} # Only run for forks (contributor) if: ${{ github.event.pull_request.head.repo.fork }} steps: - # ------------------------------------------------------------ # Setup repository # ------------------------------------------------------------ @@ -53,37 +87,31 @@ jobs: - name: "[SETUP] Determine Docker tag" id: tag - uses: cytopia/docker-tag@v0.3 + uses: cytopia/docker-tag-action@v0.4.7 # ------------------------------------------------------------ # Build # ------------------------------------------------------------ - name: Build - uses: cytopia/shell-command-retry-action@v0.1 + uses: cytopia/shell-command-retry-action@v0.1.2 with: command: | - make build ARCH=${ARCH} - env: - ARCH: ${{ matrix.arch }} + make build ARCH=${{ matrix.arch }} # ------------------------------------------------------------ # Test # ------------------------------------------------------------ - name: "[TEST] Docker Image" - uses: cytopia/shell-command-retry-action@v0.1 + uses: cytopia/shell-command-retry-action@v0.1.2 with: command: | - make test ARCH=${ARCH} - env: - ARCH: ${{ matrix.arch }} + make test ARCH=${{ matrix.arch }} - name: "[TEST] Update README" - uses: cytopia/shell-command-retry-action@v0.1 + uses: cytopia/shell-command-retry-action@v0.1.2 with: command: | - make update-readme ARCH=${ARCH} - env: - ARCH: ${{ matrix.arch }} + make update-readme ARCH=${{ matrix.arch }} - name: "[TEST] Verify README" run: | diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 57a401b..b6ddac8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,6 +21,7 @@ jobs: lint: name: "Lint" runs-on: ubuntu-latest + if: github.actor != 'dependabot[bot]' steps: # ------------------------------------------------------------ # Setup repository @@ -30,10 +31,13 @@ jobs: with: fetch-depth: 0 + - name: Output info + run: | + echo "${{ github.actor }}" + # ------------------------------------------------------------ # Lint repository # ------------------------------------------------------------ - name: Lint workflow - id: vars run: | make lint-workflow diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index eead512..1d8696f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -14,31 +14,63 @@ on: schedule: - cron: '0 0 * * *' +env: + MATRIX_VERSION: '["8.2"]' + MATRIX_ARCH: '["linux/amd64","linux/386","linux/arm64","linux/arm/v7","linux/arm/v6"]' + jobs: # ----------------------------------------------------------------------------------------------- - # Job: BUILD + # Job (1/3): Configure Pipeline + # ----------------------------------------------------------------------------------------------- + configure: + name: Configure + runs-on: ubuntu-latest + outputs: + matrix_version: ${{ steps.set-matrix-version.outputs.matrix_version }} + matrix_arch: ${{ steps.set-matrix-arch.outputs.matrix_arch }} + manifest_arch: ${{ steps.set-manifest-arch.outputs.manifest }} + steps: + + - name: "[OUTPUT] Export Matrix 'Version'" + id: set-matrix-version + run: | + echo '::set-output name=matrix_version::${{ env.MATRIX_VERSION }}' + echo "${{ env.MATRIX_VERSION }}" + + - name: "[OUTPUT] Export Matrix 'Arch'" + id: set-matrix-arch + run: | + echo '::set-output name=matrix_arch::${{ env.MATRIX_ARCH }}' + echo "${{ env.MATRIX_ARCH }}" + + - name: "[OUTPUT] Export Manifest 'Arch'" + id: set-manifest-arch + run: | + ARCH="$( echo ${{ env.MATRIX_ARCH }} | sed 's/"//g' | sed 's/\[//g' | sed 's/\]//g' | sed 's/ //g' )" + echo "::set-output name=manifest::${ARCH}" + echo "${ARCH}" + + + # ----------------------------------------------------------------------------------------------- + # Job (2/3): BUILD # ----------------------------------------------------------------------------------------------- build: - name: "[ PHP-${{ matrix.version }} (${{ matrix.arch }}) ] (ref: ${{ matrix.refs }})" + needs: configure + name: Build PHP-${{ matrix.version }} (${{ matrix.arch }}) runs-on: ubuntu-latest strategy: fail-fast: false matrix: version: - - '8.2' + - ${{ fromJson(needs.configure.outputs.matrix_version) }} arch: - - 'linux/amd64' - - 'linux/arm64' - - 'linux/386' - - 'linux/arm/v7' - - 'linux/arm/v6' + - ${{ fromJson(needs.configure.outputs.matrix_arch) }} refs: - 'master' - - '0.3' + - '0.4' steps: - # ------------------------------------------------------------ # Setup repository # ------------------------------------------------------------ @@ -56,37 +88,31 @@ jobs: - name: "[SETUP] Determine Docker tag" id: tag - uses: cytopia/docker-tag@v0.3 + uses: cytopia/docker-tag-action@v0.4.7 # ------------------------------------------------------------ # Build # ------------------------------------------------------------ - name: Build - uses: cytopia/shell-command-retry-action@v0.1 + uses: cytopia/shell-command-retry-action@v0.1.2 with: command: | - make build ARCH=${ARCH} - env: - ARCH: ${{ matrix.arch }} + make build ARCH=${{ matrix.arch }} # ------------------------------------------------------------ # Test # ------------------------------------------------------------ - name: "[TEST] Docker Image" - uses: cytopia/shell-command-retry-action@v0.1 + uses: cytopia/shell-command-retry-action@v0.1.2 with: command: | - make test ARCH=${ARCH} - env: - ARCH: ${{ matrix.arch }} + make test ARCH=${{ matrix.arch }} - name: "[TEST] Update README" - uses: cytopia/shell-command-retry-action@v0.1 + uses: cytopia/shell-command-retry-action@v0.1.2 with: command: | - make update-readme ARCH=${ARCH} - env: - ARCH: ${{ matrix.arch }} + make update-readme ARCH=${{ matrix.arch }} - name: "[TEST] Verify README" run: | @@ -101,40 +127,28 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - - name: "[DEPLOY] Publish architecture image (only repo owner)" - uses: cytopia/shell-command-retry-action@v0.1 + - name: "[DEPLOY] Publish architecture image" + uses: cytopia/shell-command-retry-action@v0.1.2 with: command: | - make push-arch TAG=${{ steps.tag.outputs.docker-tag }} ARCH=${ARCH} - env: - ARCH: ${{ matrix.arch }} - # 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 == 'push' && startsWith(github.ref, 'refs/heads/release-')) - ) + make push-arch TAG=${{ steps.tag.outputs.docker-tag }} ARCH=${{ matrix.arch }} # ----------------------------------------------------------------------------------------------- - # Job (2/2): DEPLOY + # Job (3/3): DEPLOY # ----------------------------------------------------------------------------------------------- deploy: - needs: [build] - name: "[ Deploy (ref: ${{ matrix.refs }})" + needs: [configure, build] + name: Deploy runs-on: ubuntu-latest strategy: fail-fast: false matrix: version: - - '8.2' + - ${{ fromJson(needs.configure.outputs.matrix_version) }} refs: - 'master' - - '0.3' + - '0.4' steps: - # ------------------------------------------------------------ # Setup repository # ------------------------------------------------------------ @@ -146,7 +160,7 @@ jobs: - name: "[SETUP] Determine Docker tag" id: tag - uses: cytopia/docker-tag@v0.3 + uses: cytopia/docker-tag-action@v0.4.7 # ------------------------------------------------------------ # Deploy @@ -158,22 +172,13 @@ jobs: password: ${{ secrets.DOCKERHUB_PASSWORD }} - name: "[DEPLOY] Create Docker manifest" - uses: cytopia/shell-command-retry-action@v0.1 + uses: cytopia/shell-command-retry-action@v0.1.2 with: command: | - make manifest-create TAG=${{ steps.tag.outputs.docker-tag }} ARCH="linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6" + make manifest-create TAG=${{ steps.tag.outputs.docker-tag }} ARCH="${{ needs.configure.outputs.manifest_arch }}" - - name: "[DEPLOY] Publish Docker manifest (only repo owner)" - uses: cytopia/shell-command-retry-action@v0.1 + - name: "[DEPLOY] Publish Docker manifest" + uses: cytopia/shell-command-retry-action@v0.1.2 with: command: | make manifest-push TAG=${{ steps.tag.outputs.docker-tag }} - # 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 == 'push' && startsWith(github.ref, 'refs/heads/release-')) - ) diff --git a/README.md b/README.md index 3e99af0..a4271c4 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ [![](https://images.microbadger.com/badges/image/devilbox/php-fpm-8.2.svg)](https://microbadger.com/images/devilbox/php-fpm-8.2 "php-fpm-8.2") [![License](https://img.shields.io/badge/license-MIT-%233DA639.svg)](https://opensource.org/licenses/MIT) -**Available Architectures:** `amd64`, `arm64`, `386`, `arm/v7`, `arm/v6` +**Available Architectures:** `amd64`, `i386`, `arm64`, `arm/v7`, `arm/v6` This repository will provide you a fully functional PHP-FPM 8.2 Docker image built from [official sources](https://github.com/php/php-src) nightly. It provides the base for [Devilbox PHP-FPM Docker images](https://github.com/devilbox/docker-php-fpm).