refactor: implement application-centric architecture for runtime init… #292
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 publish development images | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'runtime/**' | |
| - 'src/**' | |
| - '.github/workflows/build-publish-dev-images.yml' | |
| permissions: | |
| id-token: write | |
| contents: read | |
| env: | |
| DEPOT_PROJECT_ID: ${{ secrets.DEPOT_PROJECT_ID }} | |
| jobs: | |
| publish: | |
| name: Build and publish PHP ${{ matrix.php }} (${{ matrix.arch }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4", "8.5"] | |
| arch: [x86_64, arm64] | |
| steps: | |
| - name: Set up QEMU to run ARM images | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Depot | |
| uses: depot/setup-action@v1 | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Determine Repository and Platform | |
| id: meta | |
| run: | | |
| if [ "${{ matrix.arch }}" = "x86_64" ]; then | |
| echo "repo=ymirapp/php-runtime-dev" >> $GITHUB_OUTPUT | |
| echo "platform=linux/amd64" >> $GITHUB_OUTPUT | |
| else | |
| echo "repo=ymirapp/arm-php-runtime-dev" >> $GITHUB_OUTPUT | |
| echo "platform=linux/arm64" >> $GITHUB_OUTPUT | |
| fi | |
| echo "tag=php-${{ matrix.php }}" >> $GITHUB_OUTPUT | |
| echo "dir=php-$(echo ${{ matrix.php }} | sed 's/\.//g')" >> $GITHUB_OUTPUT | |
| - name: Build and Load Image | |
| uses: depot/build-push-action@v1 | |
| with: | |
| project: ${{ secrets.DEPOT_PROJECT_ID }} | |
| context: runtime | |
| file: runtime/${{ steps.meta.outputs.dir }}/Dockerfile | |
| platforms: ${{ steps.meta.outputs.platform }} | |
| load: true | |
| tags: ${{ steps.meta.outputs.repo }}:${{ steps.meta.outputs.tag }} | |
| build-args: | | |
| CPU_ARCHITECTURE=${{ matrix.arch }} | |
| DOCKER_PLATFORM=${{ steps.meta.outputs.platform }} | |
| - name: Verify Image | |
| run: ./runtime/test-image.sh ${{ steps.meta.outputs.repo }}:${{ steps.meta.outputs.tag }} ${{ steps.meta.outputs.platform }} | |
| - name: Build and Push Image | |
| uses: depot/build-push-action@v1 | |
| with: | |
| project: ${{ secrets.DEPOT_PROJECT_ID }} | |
| context: runtime | |
| file: runtime/${{ steps.meta.outputs.dir }}/Dockerfile | |
| platforms: ${{ steps.meta.outputs.platform }} | |
| push: true | |
| tags: ${{ steps.meta.outputs.repo }}:${{ steps.meta.outputs.tag }} | |
| build-args: | | |
| CPU_ARCHITECTURE=${{ matrix.arch }} | |
| DOCKER_PLATFORM=${{ steps.meta.outputs.platform }} |