Skip to content

Commit

Permalink
Create docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
divyanshu16 authored Sep 19, 2024
1 parent bc62f1f commit 14388be
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and Push Docker Image

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Build the Docker image
run: |
docker build . --file Dockerfile --tag ghcr.io/${{ github.repository }}/my-image-name:testing
- name: Push the Docker image
run: |
docker push ghcr.io/${{ github.repository }}/my-image-name:testing
- name: List Docker images
run: docker images

0 comments on commit 14388be

Please sign in to comment.