remove PHP 8.1 and 8.2 #2
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: Build and Push Docker Images | |
| on: | |
| # Triggered by Grav releases | |
| repository_dispatch: | |
| types: [grav-release] | |
| # Manual trigger | |
| workflow_dispatch: | |
| inputs: | |
| channel: | |
| description: 'Grav channel (stable or beta)' | |
| required: true | |
| default: 'stable' | |
| type: choice | |
| options: | |
| - stable | |
| - beta | |
| # Also build on push to master (for Dockerfile changes) | |
| push: | |
| branches: [master] | |
| paths: | |
| - 'Dockerfile' | |
| - 'docker-entrypoint.sh' | |
| - 'config/**' | |
| - '.github/workflows/build-push.yml' | |
| env: | |
| REGISTRY: docker.io | |
| IMAGE_NAME: getgrav/grav | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| matrix: | |
| include: | |
| - php: "8.3" | |
| default: true | |
| - php: "8.5" | |
| default: false | |
| - php: "8.4" | |
| default: false | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Determine tags | |
| id: tags | |
| run: | | |
| TAGS="${{ env.IMAGE_NAME }}:php${{ matrix.php }}" | |
| if [ "${{ matrix.default }}" = "true" ]; then | |
| TAGS="${TAGS},${{ env.IMAGE_NAME }}:latest,${{ env.IMAGE_NAME }}:1.7" | |
| fi | |
| echo "tags=${TAGS}" >> $GITHUB_OUTPUT | |
| - name: Build and push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| build-args: | | |
| PHP_VERSION=${{ matrix.php }} | |
| tags: ${{ steps.tags.outputs.tags }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| update-readme: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Update Docker Hub description | |
| uses: peter-evans/dockerhub-description@v4 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| repository: getgrav/grav | |
| short-description: "Official Grav CMS Docker Image" | |
| readme-filepath: ./README.md |