Skip to content

Commit

Permalink
GitHub Docker CI Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmtsvr committed Jun 14, 2024
1 parent 657cb12 commit 0764543
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/docker-image-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docker Image CI

on:
release:
types: [published]

jobs:

push_to_dockerhub:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write

steps:
- uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v3.2.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5.5.1
with:
images: mehmetsever/mongodb-compact

- name: Build and push Docker image
id: push
uses: docker/build-push-action@v5.4.0
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 0764543

Please sign in to comment.