fix ci/cd #12
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: deploy to ghcr.io | |
| on: | |
| push: | |
| branches: [ 8.4 ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| PHP_VERSION: 8.4 | |
| ALPINE_VERSION: 3.20 | |
| steps: | |
| - name: set lower case owner name | |
| run: | | |
| echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV} | |
| - name: Check Out Repo | |
| uses: actions/checkout@v4 | |
| - name: ghcr.io | |
| uses: docker/login-action@v1 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v1 | |
| - name: Build and push build | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: ./ | |
| build-args: | | |
| PHP_VERSION=${{ env.PHP_VERSION }} | |
| file: ./Dockerfile-build | |
| push: true | |
| cache-from: type=registry,ref=${{ github.repository_owner }}/build-php${{ env.PHP_VERSION }}:latest | |
| cache-to: type=inline | |
| tags: ghcr.io/${{ github.repository_owner }}/build-php${{ env.PHP_VERSION }}:latest | |
| target: build | |
| - name: Image digest | |
| run: echo ${{ steps.docker_build.outputs.digest }} | |
| - name: Build and push prod-php-fpm | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: ./ | |
| build-args: | | |
| PHP_VERSION=${{ env.PHP_VERSION }} | |
| file: ./Dockerfile-fpm | |
| push: true | |
| cache-from: type=registry,ref=${{ github.repository_owner }}/prod-php${{ env.PHP_VERSION }}-fpm:latest | |
| cache-to: type=inline | |
| tags: ghcr.io/${{ github.repository_owner }}/prod-php${{ env.PHP_VERSION }}-fpm:latest | |
| target: prod | |
| - name: Image digest | |
| run: echo ${{ steps.docker_build.outputs.digest }} | |
| - name: Build and push dev-php-fpm | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: ./ | |
| build-args: | | |
| PHP_VERSION=${{ env.PHP_VERSION }} | |
| file: ./Dockerfile-fpm | |
| push: true | |
| cache-from: type=registry,ref=${{ github.repository_owner }}/dev-php${{ env.PHP_VERSION }}-fpm:latest | |
| cache-to: type=inline | |
| tags: ghcr.io/${{ github.repository_owner }}/dev-php${{ env.PHP_VERSION }}-fpm:latest, | |
| target: dev | |
| - name: Image digest | |
| run: echo ${{ steps.docker_build.outputs.digest }} | |
| # SQLSRV version | |
| - name: Build and push build-sqlsrv | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: ./ | |
| build-args: | | |
| PHP_VERSION=${{ env.PHP_VERSION }} | |
| file: ./Dockerfile-build | |
| push: true | |
| cache-from: type=registry,ref=${{ github.repository_owner }}/build-php${{ env.PHP_VERSION }}-sqlsrv:latest | |
| cache-to: type=inline | |
| tags: ghcr.io/${{ github.repository_owner }}/build-php${{ env.PHP_VERSION }}-sqlsrv:latest | |
| target: build-sqlsrv | |
| - name: Image digest | |
| run: echo ${{ steps.docker_build.outputs.digest }} | |
| - name: Build and push prod-php-fpm-sqlsrv | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: ./ | |
| build-args: | | |
| PHP_VERSION=${{ env.PHP_VERSION }} | |
| file: ./Dockerfile-fpm | |
| push: true | |
| cache-from: type=registry,ref=${{ github.repository_owner }}/prod-php${{ env.PHP_VERSION }}-fpm-sqlsrv:latest | |
| cache-to: type=inline | |
| tags: ghcr.io/${{ github.repository_owner }}/prod-php${{ env.PHP_VERSION }}-fpm-sqlsrv:latest | |
| target: prod-sqlsrv | |
| - name: Image digest | |
| run: echo ${{ steps.docker_build.outputs.digest }} | |
| - name: Build and push dev-php-fpm-sqlsrv | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: ./ | |
| build-args: | | |
| PHP_VERSION=${{ env.PHP_VERSION }} | |
| file: ./Dockerfile-fpm | |
| push: true | |
| cache-from: type=registry,ref=${{ github.repository_owner }}/dev-php${{ env.PHP_VERSION }}-fpm-sqlsrv:latest | |
| cache-to: type=inline | |
| tags: ghcr.io/${{ github.repository_owner }}/dev-php${{ env.PHP_VERSION }}-fpm-sqlsrv:latest | |
| target: dev-sqlsrv | |
| - name: Image digest | |
| run: echo ${{ steps.docker_build.outputs.digest }} |