Skip to content

Commit e174dbc

Browse files
authored
Merge pull request #68 from Kaushl2208/feat/gh_action_docker
feat: Introduce Stage to Build and Push Docker Image Reviewed-by: [email protected], [email protected]
2 parents 69c39d1 + 40fd7ac commit e174dbc

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# SPDX-FileCopyrightText: 2024 Kaushlendra Pratap <[email protected]>
2+
# SPDX-License-Identifier: GPL-2.0-only
3+
4+
name: Build and Push Docker Image
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
docker-build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v2
21+
22+
- name: Log in to Docker Hub
23+
uses: docker/login-action@v2
24+
with:
25+
username: ${{ secrets.DOCKERHUB_USERNAME }}
26+
password: ${{ secrets.DOCKERHUB_TOKEN }}
27+
28+
- name: Build and push main image
29+
uses: docker/build-push-action@v4
30+
with:
31+
push: true
32+
tags: fossology/licensedb:latest
33+
context: .
34+
cache-from: type=gha
35+
cache-to: type=gha,mode=max
36+
37+
- name: Log out from Docker Hub
38+
run: docker logout

0 commit comments

Comments
 (0)