Skip to content

Bump docker/scout-action from 0.18.1 to 1.7.1 #349

Bump docker/scout-action from 0.18.1 to 1.7.1

Bump docker/scout-action from 0.18.1 to 1.7.1 #349

---
name: Build and Push Backend
on:
workflow_dispatch:
push:
branches: [main]
paths:
- "backend/**"
- "!backend/README.md"
- ".github/workflows/build-and-push-backend.yaml"
tags:
- "v*"
pull_request:
branches: [main]
paths:
- "backend/**"
- "!backend/README.md"
- ".github/workflows/build-and-push-backend.yaml"
jobs:
build-and-push:
name: Build and push image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
env:
DOCKER_METADATA_PR_HEAD_SHA: true
with:
images: ${{ secrets.REGISTRY_LOGIN_SERVER }}/alphafold
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=edge
type=ref,event=pr
type=sha
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./backend
build-args: |
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
RELEASE_ID=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
load: ${{ github.event_name == 'pull_request' }}
push: ${{ 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
- name: Docker Scout
id: docker-scout
if: ${{ github.event_name == 'pull_request' }}
uses: docker/scout-action@v1.7.1
with:
command: compare
image: ${{ secrets.REGISTRY_LOGIN_SERVER }}/alphafold:${{ steps.meta.outputs.version }}
to: ${{ secrets.REGISTRY_LOGIN_SERVER }}/alphafold:edge
exit-code: true
write-comment: true
github-token: ${{ secrets.GITHUB_TOKEN }} # to be able to write the comment