Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated workflow #10

Merged
merged 8 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 4 additions & 28 deletions .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,15 @@
name: Build Docker Images

on:
workflow_run:
workflows: [Tests]
types: [completed]
push:
branches:
- main
- dev
- demo
pull_request:
branches:
- main
- dev
- demo
types:
- opened
- ready_for_review
- reopened
- synchronize
merge_group:

jobs:
test-job:
name: Test Step
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_branch }}
- run: git branch
- run: env

docker-build:
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
strategy:
matrix:
include:
Expand All @@ -44,10 +21,9 @@ jobs:
dockerfile: docker/Frontend.Dockerfile
uses: ./.github/workflows/build-docker.yml
with:
registry: ${{ github.event.workflow_run.head_branch == 'main' && 'fruoccopublic.azurecr.io' || 'cwydcontainerreg.azurecr.io'}}
username: ${{ github.event.workflow_run.head_branch == 'main' && 'fruoccopublic' || 'cwydcontainerreg'}}
registry: ${{ github.ref_name == 'main' && 'fruoccopublic.azurecr.io' || 'cwydcontainerreg.azurecr.io'}}
username: ${{ github.ref_name == 'main' && 'fruoccopublic' || 'cwydcontainerreg'}}
app_name: ${{ matrix.app_name }}
dockerfile: ${{ matrix.dockerfile }}
branch: ${{ github.event.workflow_run.head_branch }}
push: ${{ github.event_name == 'workflow_run' && (github.event.workflow_run.head_branch == 'main' || github.event.workflow_run.head_branch == 'dev' || github.event.workflow_run.head_branch == 'demo') }}
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' }}
secrets: inherit
11 changes: 5 additions & 6 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ on:
dockerfile:
required: true
type: string
branch:
required: true
type: string
push:
required: true
type: boolean
Expand All @@ -31,10 +28,12 @@ jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: Get branch detail
- name: Print branch detail
run: |
echo "Input status ${{ inputs.push }}"
echo "Input branch ${{ inputs.branch }}"
echo "${{ inputs.push }}"
echo "${{ github.ref_name }}"
- name: Checkout
uses: actions/checkout@v4

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