Skip to content

Commit

Permalink
Merge pull request #1932 from opengovern/ui-changes
Browse files Browse the repository at this point in the history
fix: workflow front
  • Loading branch information
mohamadch91 authored Nov 11, 2024
2 parents 819d787 + 6811846 commit 383057d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
environment: golang
outputs:
latest_tag: ${{ steps.set_latest_tag.outputs.latest_tag }}
if: github.event.pull_request.head.ref != 'ui-changes'&& github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev')
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && ( ! contains(github.event.head_commit.message, 'ui-changes') )
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
22 changes: 6 additions & 16 deletions .github/workflows/ui.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
name: Web UI Build

on:
workflow_dispatch:
inputs:
deployTo:
type: choice
description: "Environment to deploy to"
options:
- "dev"
- "prod"
default: "dev"
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ] # This will trigger on PRs targeting the `main` branch
branches:
- main # Only run this workflow on pushes to the main branch

jobs:
build:
if: github.event.pull_request.head.ref == 'ui-changes'
environment: web
# Check if the last commit is a merge from the `ui-changes` branch
if: contains(github.event.head_commit.message, 'Merge pull request') && contains(github.event.head_commit.message, 'ui-changes')
runs-on: ubuntu-latest
permissions:
id-token: write
Expand Down Expand Up @@ -71,7 +61,7 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: Log in to the Container Registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand All @@ -84,7 +74,7 @@ jobs:
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ github.repository_owner }}/web-ui:${{ steps.tag_version.outputs.new_tag }}-${{ github.event.inputs.deployTo || 'dev' }}
ghcr.io/${{ github.repository_owner }}/web-ui:${{ steps.tag_version.outputs.new_tag }}
file: docker/WebUiDockerfile
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 383057d

Please sign in to comment.