-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (31 loc) · 1018 Bytes
/
docker-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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 }}