Skip to content

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Guru322 authored Aug 9, 2024
1 parent c111750 commit 774e4f6
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,29 @@ on:
branches: [ "main" ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
- name: Checkout source code
uses: actions/checkout@v4

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

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.REG_TOKEN }}

- name: Build and tag the Docker image
run: |
docker build . --file Dockerfile --tag ghcr.io/${{ github.repository_owner }}/DEPLOY-GURU:${{ github.sha }}
- name: Push the Docker image
run: |
docker push ghcr.io/${{ github.repository_owner }}/DEPLOY-GURU:${{ github.sha }}

0 comments on commit 774e4f6

Please sign in to comment.