Skip to content

Commit

Permalink
Fixed branch on workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
umerfaruk committed May 27, 2024
1 parent 1539e51 commit a191f3c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 60 deletions.
68 changes: 34 additions & 34 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
name: Docker Image CI

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
push:
branches: ["master"]
pull_request:
branches: ["master"]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Docker Login
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PASSWORD }}
- name: Docker Login
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
26 changes: 0 additions & 26 deletions .github/workflows/main.yml

This file was deleted.

0 comments on commit a191f3c

Please sign in to comment.