Skip to content

Update permissions in Trivy GitHub Actions workflow #64

Update permissions in Trivy GitHub Actions workflow

Update permissions in Trivy GitHub Actions workflow #64

name: Publish Docker image to Dockerhub
on:
push:
branches: ['main']
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: metadata
uses: docker/metadata-action@v4
with:
images: siddhantprateek/qdapi
- name: Build and push Docker image
uses: mr-smithers-excellent/docker-build-push@v6
with:
image: siddhantprateek/qdapi
push: true
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
tags: latest
labels: ${{ steps.meta.outputs.labels }}