Skip to content

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
d4sh4-ru authored Jan 10, 2025
1 parent ff62551 commit ad75919
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ name: Build and Push to GitHub Container Registry

on:
push:
branches: [ "master" ]
branches:
- "master"
- "dev-course"
pull_request:
branches: [ "master" ]
branches:
- "master"
- "dev-course"

jobs:
build-and-push:
Expand All @@ -17,8 +21,18 @@ jobs:
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GHCR_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_owner }}/medical-backend:latest
- name: Build the Docker image for medical-backend
run: |
if [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
docker build . --file Dockerfile --tag ghcr.io/${{ github.repository_owner }}/medical-backend:latest
elif [[ "${{ github.ref }}" == "refs/heads/dev-course" ]]; then
docker build . --file Dockerfile --tag ghcr.io/${{ github.repository_owner }}/medical-backend-course:latest
fi
- name: Push the Docker image to GHCR
run: docker push ghcr.io/${{ github.repository_owner }}/medical-backend:latest
run: |
if [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
docker push ghcr.io/${{ github.repository_owner }}/medical-backend:latest
elif [[ "${{ github.ref }}" == "refs/heads/dev-course" ]]; then
docker push ghcr.io/${{ github.repository_owner }}/medical-backend-course:latest
fi

0 comments on commit ad75919

Please sign in to comment.