From 5d0d80ebc3178b193a80eb7fbb2f4eff0b516268 Mon Sep 17 00:00:00 2001 From: brusnitsyn Date: Tue, 17 Mar 2026 14:44:09 +0900 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B2=20build-docker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-docker.yml | 31 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 3c448ec..c1d5213 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -2,10 +2,7 @@ name: Build and Push Docker Image on: push: - branches: [main, master] - tags: ['v*'] - pull_request: - branches: [main, master] + branches: [master] env: REGISTRY: registry.brusoff.su @@ -19,34 +16,34 @@ jobs: uses: actions/setup-node@v4 with: node-version: '20' - + - name: Checkout uses: actions/checkout@v4 - + - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: '8.3' extensions: mbstring, xml, ctype, iconv, intl, pdo_mysql, pdo_pgsql, gd, redis, zip coverage: none - + - name: Validate composer.json run: composer validate --strict - + - name: Install dependencies run: composer install --prefer-dist --no-progress --no-suggest - + - name: Run PHP tests run: vendor/bin/phpunit build: runs-on: docker #if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) - + steps: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - + - name: Cache Docker layers uses: actions/cache@v3 with: @@ -54,14 +51,14 @@ jobs: key: ${{ runner.os }}-buildx-${{ github.sha }} restore-keys: | ${{ runner.os }}-buildx- - + - name: Login to Registry uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_PASSWORD }} - + - name: Extract metadata id: meta uses: docker/metadata-action@v5 @@ -74,7 +71,7 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=sha,prefix={{branch}}- type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' }} - + - name: Build and push uses: docker/build-push-action@v5 with: @@ -87,16 +84,16 @@ jobs: platforms: linux/amd64,linux/arm64 build-args: | BUILDKIT_INLINE_CACHE=1 - + - name: Scan image for vulnerabilities uses: aquasecurity/trivy-action@master with: image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest format: 'sarif' output: 'trivy-results.sarif' - + - name: Upload Trivy scan results uses: github/codeql-action/upload-sarif@v2 if: always() with: - sarif_file: 'trivy-results.sarif' \ No newline at end of file + sarif_file: 'trivy-results.sarif'