Skip to content

Commit a538be8

Browse files
authored
Create docker.yml
1 parent 73bad21 commit a538be8

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/docker.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
name: Docker build
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout the repo
15+
uses: actions/checkout@v3
16+
- name: Build the Docker image
17+
uses: docker/login-action@v2
18+
with:
19+
username: ${{ secrets.DOCKERHUB_USERNAME }}
20+
password: ${{ secrets.DOCKERHUB_TOKEN }}
21+
- name: Build the Docker image
22+
run: docker build --platform linux --tag ${{ secrets.DOCKERHUB_USERNAME }}/backenddockerci:latest -f Dockerfile .
23+
- name: Push the Docker image
24+
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/backenddockerci:latest

0 commit comments

Comments
 (0)