Skip to content

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dewgenenny authored Sep 28, 2024
1 parent eb67fb0 commit 3d4020d
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
name: Docker Image CI

name: Build Docker Image
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

branches:
- main
jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag moca_stats:$(date +%s)
build:
name: push docker image to docker hub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: login to docker hub
id: docker-hub
env:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_PASSWORD}}
run: |
docker login -u $username -p $password
- name: build the docker image
id: build-docker-image
run: |
ls -la
docker build . -f Dockerfile -t dhruvin30/demo-image-test:latest
- name: push the docker image
id: push-docker-image
run: docker push ${{secrets.DOCKERHUB_USERNAME}}/demo-image-test:latest

0 comments on commit 3d4020d

Please sign in to comment.