fix build #897
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: CI | |
| on: | |
| pull_request: | |
| push: | |
| schedule: | |
| - cron: '20 2 1,15 * *' | |
| jobs: | |
| unit: | |
| name: Templating | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/mvorisek/image-php | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: "Check if files are in-sync" | |
| run: | | |
| rm -r data/ | |
| php make.php | |
| git add . -N && git diff --exit-code | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| env: | |
| REGISTRY_NAME: ghcr.io | |
| REGISTRY_IMAGE_NAME: ghcr.io/${{ github.repository }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| imageName: | |
| - "8.4-alpine" | |
| - "8.5-alpine" | |
| - "8.4-debian" | |
| - "8.5-debian" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: 'Target "basic" - build' | |
| # try to build twice to suppress random network issues with Github Actions | |
| run: >- | |
| sed -i 's~^[ \t]*~~' data/${{ matrix.imageName }}/Dockerfile | |
| && (docker build -f data/${{ matrix.imageName }}/Dockerfile --target "basic" -t "ci-target:basic" ./ | |
| || docker build -f data/${{ matrix.imageName }}/Dockerfile --target "basic" -t "ci-target:basic" ./) | |
| - name: 'Target "basic" - test' | |
| # try to build twice to suppress random network issues with Github Actions | |
| run: >- | |
| sed -i 's~^[ \t]*~~' data/${{ matrix.imageName }}/Dockerfile | |
| && (docker build -f data/${{ matrix.imageName }}/Dockerfile --target "basic__test" -t "ci-target:basic__test" ./ | |
| || docker build -f data/${{ matrix.imageName }}/Dockerfile --target "basic__test" -t "ci-target:basic__test" ./) | |
| - name: Login to registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY_NAME }} | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: 'Push tags to registry - 8.4.x' | |
| if: (github.ref == 'refs/heads/master') && (matrix.imageName == '8.4-alpine' || matrix.imageName == '8.4-debian') | |
| run: >- | |
| dtp() { docker tag "ci-target:$1" "$REGISTRY_IMAGE_NAME:$2" && docker push "$REGISTRY_IMAGE_NAME:$2"; } | |
| && if [ "${{ matrix.imageName }}" == "8.4-alpine" ]; then | |
| dtp "base" "8.4-base" | |
| && dtp "base" "8.4-alpine-base" | |
| && dtp "basic" "8.4" | |
| && dtp "basic" "8.4-alpine" | |
| ; elif [ "${{ matrix.imageName }}" == "8.4-debian" ]; then | |
| dtp "base" "8.4-debian-base" | |
| && dtp "basic" "8.4-debian" | |
| ; fi | |
| - name: 'Push tags to registry - 8.5.x' | |
| if: (github.ref == 'refs/heads/master') && (matrix.imageName == '8.5-alpine' || matrix.imageName == '8.5-debian') | |
| run: >- | |
| dtp() { docker tag "ci-target:$1" "$REGISTRY_IMAGE_NAME:$2" && docker push "$REGISTRY_IMAGE_NAME:$2"; } | |
| && if [ "${{ matrix.imageName }}" == "8.5-alpine" ]; then | |
| dtp "base" "8.5-base" | |
| && dtp "base" "8.5-alpine-base" | |
| && dtp "basic" "8.5" | |
| && dtp "basic" "8.5-alpine" | |
| ; elif [ "${{ matrix.imageName }}" == "8.5-debian" ]; then | |
| dtp "base" "8.5-debian-base" | |
| && dtp "basic" "8.5-debian" | |
| ; fi |