Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
KNarendra99599 authored Jun 20, 2024
1 parent a9fb4a5 commit 608adec
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
name: Hprofile Actions
on: workflow_dispatch # [push, workflow_dispatch]
#on:
# pull_request:
# types:
# - closed # Trigger the workflow when a pull request is closed
#on: workflow_dispatch # [push, workflow_dispatch]
on:
pull_request:
types:
- closed # Trigger the workflow when a pull request is closed

env:
AWS_REGION: us-east-1
jobs:

# If_merged:
# if: false # This condition effectively skips the job
# if: github.event.pull_request.merged == true # Check if the pull request was merged
# runs-on: ubuntu-latest # Specify the runner
# steps:
# - run: |
# echo The PR was merged # Print a message if the pull request was merged
If_merged:
# if: false # This condition effectively skips the job
if: github.event.pull_request.merged == true # Check if the pull request was merged
runs-on: ubuntu-latest # Specify the runner
steps:
- run: |
echo The PR was merged # Print a message if the pull request was merged
Testing:
if: false # This condition effectively skips the job
# needs: If_merged
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -63,7 +64,7 @@ jobs:
SONAR_HOST_URL: ${{ secrets.SONAR_URL }} #OPTIONAL

BUILD_AND_PUBLISH:
if: false # This condition effectively skips the job
# if: false # This condition effectively skips the job
needs: Testing
runs-on: ubuntu-latest
steps:
Expand All @@ -86,8 +87,12 @@ jobs:
region: ${{ env.AWS_REGION }}
tags: ${{ github.run_number }} #latest,${{ github.run_number }}
daemon_off: false
dockerfile: ./Dockerfile
context: ./
# dockerfile: ./Dockerfile
# context: ./

run: |
docker build -t $registry:$repo:$tags .
docker push $registry:$repo:$tags
- name: Update Image tag
run: |
Expand Down

0 comments on commit 608adec

Please sign in to comment.