Release #57
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: Release | |
| on: | |
| push: | |
| branches: | |
| - master | |
| schedule: | |
| # Weekly builds to pick up Alpine security patches | |
| - cron: '0 4 * * 1' | |
| jobs: | |
| push-to-registry: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: [ "8.1", "8.2", "8.3", "8.4" ] | |
| arch: [ | |
| "linux/amd64,linux/arm64,linux/arm/v8,linux/arm/v7", | |
| ] | |
| env: | |
| VERSION: ${{ matrix.version }} | |
| ARCHS: ${{ matrix.arch }} | |
| REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} | |
| name: release-${{ matrix.version }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: "all" | |
| - name: Set up Docker Buildx | |
| id: buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| if: env.REGISTRY_USERNAME != '' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.REGISTRY_USERNAME }} | |
| password: ${{ secrets.REGISTRY_PASSWORD }} | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push (Docker Hub) | |
| if: env.REGISTRY_USERNAME != '' | |
| run: make release | |
| - name: Build only (no push credentials) | |
| if: env.REGISTRY_USERNAME == '' | |
| run: make build | |
| - name: Push to GHCR | |
| if: env.REGISTRY_USERNAME != '' | |
| run: | | |
| SEMVER=$(docker run --rm -v $(pwd):/app jorge07/alpine-php:${VERSION} php -r "echo phpversion();") | |
| docker buildx imagetools create --tag ghcr.io/jorge07/alpine-php:${VERSION} jorge07/alpine-php:${VERSION} | |
| docker buildx imagetools create --tag ghcr.io/jorge07/alpine-php:${VERSION}-dev jorge07/alpine-php:${VERSION}-dev | |
| docker buildx imagetools create --tag ghcr.io/jorge07/alpine-php:${SEMVER} jorge07/alpine-php:${SEMVER} | |
| docker buildx imagetools create --tag ghcr.io/jorge07/alpine-php:${SEMVER}-dev jorge07/alpine-php:${SEMVER}-dev |