Skip to content

Update scan.yml

Update scan.yml #6

Workflow file for this run

name: Container Scan Test
on:
workflow_dispatch:
push:
branches:
- feature/ci-container-image-audit
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
release:
types: [published]
env:
CARGO_TERM_COLOR: always
RUST_VERSION: 1.73.0
NIGHTLY_RUST_VERSION: nightly-2023-10-29
RUSTFLAGS: -D warnings
REGISTRY: ghcr.io
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-scan-docker-image:
runs-on: buildjet-4vcpu-ubuntu-2204
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/fuellabs/fuel-core
tags: |
type=sha
type=ref,event=branch
type=ref,event=tag
type=semver,pattern={{raw}}
type=raw,value=sha-{{sha}}-{{date 'YYYYMMDDhhmmss'}}
flavor: |
latest=${{ github.ref == 'refs/heads/master' }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to the ghcr.io registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to the docker.io registry
uses: docker/login-action@v2
with:
username: fuellabs
password: ${{ secrets.DOCKER_IO_READ_ONLY_TOKEN }}
- name: Build and push the image to ghcr.io
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
file: deployment/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=ghcr.io/fuellabs/fuel-core-build-cache:latest
cache-to: type=registry,ref=ghcr.io/fuellabs/fuel-core-build-cache:latest,mode=max
- name: Scan Container Image
uses: crazy-max/ghaction-container-scan@v3
with:
image: ${{ fromJSON(steps.meta.outputs.json).tags[0] }}