diff --git a/content/scout/integrations/ci/gha.md b/content/scout/integrations/ci/gha.md index 267c37db94..1caaee0f3b 100644 --- a/content/scout/integrations/ci/gha.md +++ b/content/scout/integrations/ci/gha.md @@ -54,51 +54,51 @@ jobs: permissions: pull-requests: write -steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - ref: ${{ env.SHA }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ env.SHA }} - - name: Setup Docker buildx - uses: docker/setup-buildx-action@v3 + - name: Setup Docker buildx + uses: docker/setup-buildx-action@v3 - # Authenticate to the container registry - - name: Authenticate to registry ${{ env.REGISTRY }} - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ secrets.REGISTRY_USER }} - password: ${{ secrets.REGISTRY_TOKEN }} + # Authenticate to the container registry + - name: Authenticate to registry ${{ env.REGISTRY }} + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_TOKEN }} - # Extract metadata (tags, labels) for Docker - - name: Extract Docker metadata - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - labels: | - org.opencontainers.image.revision=${{ env.SHA }} - tags: | - type=edge,branch=$repo.default_branch - type=semver,pattern=v{{version}} - type=sha,prefix=,suffix=,format=short + # Extract metadata (tags, labels) for Docker + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + labels: | + org.opencontainers.image.revision=${{ env.SHA }} + tags: | + type=edge,branch=$repo.default_branch + type=semver,pattern=v{{version}} + type=sha,prefix=,suffix=,format=short - # Build and push Docker image with Buildx - # (don't push on PR, load instead) - - name: Build and push Docker image - id: build-and-push - uses: docker/build-push-action@v5 - with: - context: . - sbom: ${{ github.event_name != 'pull_request' }} - provenance: ${{ github.event_name != 'pull_request' }} - push: ${{ github.event_name != 'pull_request' }} - load: ${{ github.event_name == 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max + # Build and push Docker image with Buildx + # (don't push on PR, load instead) + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@v5 + with: + context: . + sbom: ${{ github.event_name != 'pull_request' }} + provenance: ${{ github.event_name != 'pull_request' }} + push: ${{ github.event_name != 'pull_request' }} + load: ${{ github.event_name == 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max ``` This creates workflow steps to: