Bump docker/metadata-action from 5.3.0 to 5.5.1 #1
Workflow file for this run
This file contains hidden or 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: 'AdoptOpenJDK 8 JRE Docker image build and push to Docker Hub' | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- main | |
env: | |
REGISTRY: docker.io | |
IMAGE_NAME: mablanco/adoptopenjdk8-jre-hotspot | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
security-events: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Log into registry ${{ env.REGISTRY }} | |
uses: docker/[email protected] | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/[email protected] | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
- name: Build and Push Docker image | |
uses: docker/[email protected] | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Scan image for vulnerabilities | |
uses: anchore/[email protected] | |
id: scan | |
with: | |
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | |
fail-build: false | |
only-fixed: true | |
- name: Inspect SARIF report | |
run: cat ${{ steps.scan.outputs.sarif }} | |
- name: Upload scan SARIF report | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: ${{ steps.scan.outputs.sarif }} |