Update Docker image build process and add user-friendly landing page #92
Workflow file for this run
This file contains hidden or 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: Docker | |
| on: | |
| push: | |
| branches: [ master ] | |
| # Publish semver tags as releases. | |
| tags: [ '*.*.*' ] | |
| pull_request: | |
| branches: [ master ] | |
| workflow_dispatch: | |
| inputs: | |
| push: | |
| description: 'Push Image (true or false)' | |
| type: choice | |
| options: | |
| - "true" | |
| - "false" | |
| required: true | |
| jobs: | |
| Build-Base: | |
| runs-on: 'ubuntu-latest' | |
| strategy: | |
| matrix: | |
| php-version: | |
| - "8.5" | |
| - "8.4" | |
| - "8.3" | |
| - "8.2" | |
| steps: | |
| - name: Get current date | |
| run: | | |
| echo "YEAR=$(date +'%Y')" >> $GITHUB_ENV | |
| echo "MONTH=$(date +'%m')" >> $GITHUB_ENV | |
| - uses: actions/checkout@v4 | |
| - name: Install requirements | |
| run: pip install -r requirements.txt | |
| - name: Log into registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ secrets.DOCKER_REGISTRY }} | |
| username: ${{ secrets.DOCKER_REGISTRY_USER }} | |
| password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Generate Dockerfiles | |
| run: python3 ./build.py ${{ matrix.php-version }} --build-base | |
| - name: Build Docker image base | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: Dockerfile-php-${{ matrix.php-version }}-base | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name != 'pull_request' || github.event.inputs.push == 'true' }} | |
| tags: | | |
| byjg/php:${{ matrix.php-version }}-base, | |
| byjg/php:${{ matrix.php-version }}-base-${{ env.YEAR }}.${{ env.MONTH }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| Build-CLI: | |
| if: github.ref == 'refs/heads/master' | |
| needs: Build-Base | |
| runs-on: 'ubuntu-latest' | |
| strategy: | |
| matrix: | |
| php-version: | |
| - "8.5" | |
| - "8.4" | |
| - "8.3" | |
| - "8.2" | |
| steps: | |
| - name: Get current date | |
| run: | | |
| echo "YEAR=$(date +'%Y')" >> $GITHUB_ENV | |
| echo "MONTH=$(date +'%m')" >> $GITHUB_ENV | |
| - uses: actions/checkout@v4 | |
| - name: Install requirements | |
| run: pip install -r requirements.txt | |
| - name: Log into registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ secrets.DOCKER_REGISTRY }} | |
| username: ${{ secrets.DOCKER_REGISTRY_USER }} | |
| password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Generate Dockerfiles | |
| run: python3 ./build.py ${{ matrix.php-version }} --build-cli | |
| - name: Build Docker image cli | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: Dockerfile-php-${{ matrix.php-version }}-cli | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name != 'pull_request' || github.event.inputs.push == 'true' }} | |
| tags: | | |
| byjg/php:${{ matrix.php-version }}-cli, | |
| byjg/php:${{ matrix.php-version }}-cli-${{ env.YEAR }}.${{ env.MONTH }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| Build-FPM: | |
| if: github.ref == 'refs/heads/master' | |
| needs: Build-Base | |
| runs-on: 'ubuntu-latest' | |
| strategy: | |
| matrix: | |
| php-version: | |
| - "8.5" | |
| - "8.4" | |
| - "8.3" | |
| - "8.2" | |
| steps: | |
| - name: Get current date | |
| run: | | |
| echo "YEAR=$(date +'%Y')" >> $GITHUB_ENV | |
| echo "MONTH=$(date +'%m')" >> $GITHUB_ENV | |
| - uses: actions/checkout@v4 | |
| - name: Install requirements | |
| run: pip install -r requirements.txt | |
| - name: Log into registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ secrets.DOCKER_REGISTRY }} | |
| username: ${{ secrets.DOCKER_REGISTRY_USER }} | |
| password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Generate Dockerfiles | |
| run: python3 ./build.py ${{ matrix.php-version }} --build-fpm | |
| - name: Build Docker image fpm | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: Dockerfile-php-${{ matrix.php-version }}-fpm | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name != 'pull_request' || github.event.inputs.push == 'true' }} | |
| tags: | | |
| byjg/php:${{ matrix.php-version }}-fpm, | |
| byjg/php:${{ matrix.php-version }}-fpm-${{ env.YEAR }}.${{ env.MONTH }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| Build-FPM-Apache: | |
| if: github.ref == 'refs/heads/master' | |
| needs: Build-FPM | |
| runs-on: 'ubuntu-latest' | |
| strategy: | |
| matrix: | |
| php-version: | |
| - "8.5" | |
| - "8.4" | |
| - "8.3" | |
| - "8.2" | |
| steps: | |
| - name: Get current date | |
| run: | | |
| echo "YEAR=$(date +'%Y')" >> $GITHUB_ENV | |
| echo "MONTH=$(date +'%m')" >> $GITHUB_ENV | |
| - uses: actions/checkout@v4 | |
| - name: Install requirements | |
| run: pip install -r requirements.txt | |
| - name: Log into registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ secrets.DOCKER_REGISTRY }} | |
| username: ${{ secrets.DOCKER_REGISTRY_USER }} | |
| password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Generate Dockerfiles | |
| run: python3 ./build.py ${{ matrix.php-version }} --build-fpm-apache | |
| - name: Build Docker image fpm-apache | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: Dockerfile-php-${{ matrix.php-version }}-fpm-apache | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name != 'pull_request' || github.event.inputs.push == 'true' }} | |
| tags: | | |
| byjg/php:${{ matrix.php-version }}-fpm-apache, | |
| byjg/php:${{ matrix.php-version }}-fpm-apache-${{ env.YEAR }}.${{ env.MONTH }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| Build-FPM-Nginx: | |
| if: github.ref == 'refs/heads/master' | |
| needs: Build-FPM | |
| runs-on: 'ubuntu-latest' | |
| strategy: | |
| matrix: | |
| php-version: | |
| - "8.5" | |
| - "8.4" | |
| - "8.3" | |
| - "8.2" | |
| steps: | |
| - name: Get current date | |
| run: | | |
| echo "YEAR=$(date +'%Y')" >> $GITHUB_ENV | |
| echo "MONTH=$(date +'%m')" >> $GITHUB_ENV | |
| - uses: actions/checkout@v4 | |
| - name: Install requirements | |
| run: pip install -r requirements.txt | |
| - name: Log into registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ secrets.DOCKER_REGISTRY }} | |
| username: ${{ secrets.DOCKER_REGISTRY_USER }} | |
| password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Generate Dockerfiles | |
| run: python3 ./build.py ${{ matrix.php-version }} --build-fpm-nginx | |
| - name: Build Docker image fpm-nginx | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: Dockerfile-php-${{ matrix.php-version }}-fpm-nginx | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name != 'pull_request' || github.event.inputs.push == 'true' }} | |
| tags: | | |
| byjg/php:${{ matrix.php-version }}-fpm-nginx, | |
| byjg/php:${{ matrix.php-version }}-fpm-nginx-${{ env.YEAR }}.${{ env.MONTH }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| Build-Nginx: | |
| if: github.ref == 'refs/heads/master' | |
| needs: Build-Base | |
| runs-on: 'ubuntu-latest' | |
| strategy: | |
| matrix: | |
| php-version: | |
| - "8.5" | |
| - "8.4" | |
| - "8.3" | |
| - "8.2" | |
| steps: | |
| - name: Get current date | |
| run: | | |
| echo "YEAR=$(date +'%Y')" >> $GITHUB_ENV | |
| echo "MONTH=$(date +'%m')" >> $GITHUB_ENV | |
| - uses: actions/checkout@v4 | |
| - name: Install requirements | |
| run: pip install -r requirements.txt | |
| - name: Log into registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ secrets.DOCKER_REGISTRY }} | |
| username: ${{ secrets.DOCKER_REGISTRY_USER }} | |
| password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Generate Dockerfiles | |
| run: python3 ./build.py ${{ matrix.php-version }} --build-nginx | |
| - name: Build Docker image nginx | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: Dockerfile-php-${{ matrix.php-version }}-nginx | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name != 'pull_request' || github.event.inputs.push == 'true' }} | |
| tags: | | |
| byjg/php:${{ matrix.php-version }}-nginx, | |
| byjg/php:${{ matrix.php-version }}-nginx-${{ env.YEAR }}.${{ env.MONTH }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| Documentation: | |
| if: github.ref == 'refs/heads/master' | |
| needs: [Build-Base, Build-CLI, Build-FPM, Build-FPM-Apache, Build-FPM-Nginx, Build-Nginx] | |
| uses: byjg/byjg.github.io/.github/workflows/add-doc.yaml@master | |
| with: | |
| folder: devops | |
| project: ${{ github.event.repository.name }} | |
| secrets: inherit |