Skip to content

Commit

Permalink
updated workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
AjitPadhi-Microsoft committed Dec 5, 2024
1 parent 116e0c9 commit 95a35c4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Build Docker Images

on:
push:
workflow_run:
workflows: [Tests]
types: [completed]
branches:
- main
- dev
Expand All @@ -22,14 +24,17 @@ jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Print branch name
run: |
echo "GITHUB_REF: ${{ github.ref}}"
echo "GITHUB_REF: ${{ github.ref_name}}
echo "GITHUB_EVENT_NAME: ${{ github.event_name}}"
echo "GITHUB_HEAD_REF: ${{ github.head_ref}}
echo "GITHUB_BASE_REF: ${{ github.base_ref}}
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}
- name: Extract branch name
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Print branch name
run: echo "${{ steps.extract_branch.outputs.branch }}"
docker-build:
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
strategy:
matrix:
include:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:

- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}

- name: Docker Login
if: ${{ inputs.push == true && github.ref_name == 'main' }}
Expand Down

0 comments on commit 95a35c4

Please sign in to comment.