Update build_and_push_image.yml #9
Workflow file for this run
This file contains 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 push image | |
on: | |
push: | |
tags: | |
- "*" | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build-and-push-arm64: | |
runs-on: ubuntu-24.04-arm | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to ghcr.io | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push image | |
uses: docker/build-push-action@v6.1.0 | |
with: | |
context: . | |
platforms: linux/arm64 | |
push: true | |
tags: ghcr.io/lidofinance/scripts:${{ github.ref_name }}-arm64 | |
build-and-push-amd64: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to ghcr.io | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push image | |
uses: docker/build-push-action@v6.1.0 | |
with: | |
context: . | |
platforms: linux/amd64 | |
push: true | |
tags: ghcr.io/lidofinance/scripts:${{ github.ref_name }}-amd64 | |
docker-manifest: | |
runs-on: ubuntu-24.04 | |
needs: [build-and-push-arm64, build-and-push-amd64] | |
steps: | |
- name: Login to ghcr.io | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create and push manifest images | |
uses: Noelware/docker-manifest-action@master | |
with: | |
inputs: ghcr.io/lidofinance/scripts:${{ github.ref_name }} | |
images: ghcr.io/lidofinance/scripts:${{ github.ref_name }}-amd64,ghcr.io/lidofinance/scripts:${{ github.ref_name }}-arm64 | |
push: true | |
run-trivy: | |
needs: docker-manifest | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Run Trivy vulnerability scanner | |
uses: aquasecurity/trivy-action@0.28.0 | |
with: | |
image-ref: 'ghcr.io/lidofinance/scripts:${{ github.ref_name }}' | |
format: 'table' | |
exit-code: '0' | |
ignore-unfixed: true | |
vuln-type: 'os,library' | |
severity: 'CRITICAL,HIGH' |