Skip to content

Commit

Permalink
Merge pull request #37 from eclipse-tractusx/fix-build-workflow-triggers
Browse files Browse the repository at this point in the history
fix(build): trigger build workflow on pushed tags
  • Loading branch information
SebastianBezold authored Sep 4, 2023
2 parents b37cd32 + ef8ea67 commit 671ec82
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 28 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,22 @@ on:
push:
branches:
- main
- 'releases/**'
- 'release/*'
# Can be scheduled on all branches and version tags
tags:
- 'v*.*.*'
- 'v*.*.*-*'
# Runs automatically on all code-related PRs to main and release branches
pull_request:
branches:
- main
- 'releases/**'
- 'release/*'
paths-ignore:
- 'charts/**'
- 'docs/**'
- '**/*.md'
# Can be scheduled on all branches and version tags
# Manual workflow trigger
workflow_dispatch:
tags:
- 'v*.*.*'
- 'v*.*.*-*'
branches:
- '*'

# the docker registry and namespace
env:
Expand Down Expand Up @@ -73,7 +72,7 @@ jobs:
# Setup build environment
- uses: ./.github/actions/setup-java

# Enabled deployment access (if either running on main or a version tag on eclipse-tractusx)
# Enabled deployment access (if either running on main or a version tag on eclipse-tractusx)
- name: Login to GitHub Container Registry
if: ${{ github.repository == 'eclipse-tractusx/knowledge-agents' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) }}
uses: docker/login-action@v2
Expand All @@ -82,7 +81,7 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

# Run Maven Deploy (if either running on main or a version tag on eclipse-tractusx)
# Run Maven Deploy (if either running on main or a version tag on eclipse-tractusx)
- name: Deploy Java via Maven
if: ${{ github.repository == 'eclipse-tractusx/knowledge-agents' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) }}
run: |
Expand All @@ -107,7 +106,7 @@ jobs:
with:
images: |
${{ env.IMAGE_NAMESPACE }}/conforming-agent
# Automatically prepare image tags; See action docs for more examples.
# Automatically prepare image tags; See action docs for more examples.
# semver patter will generate tags like these for example :1 :1.2 :1.2.3
tags: |
type=sha,event=branch
Expand All @@ -134,7 +133,7 @@ jobs:
if: ${{ github.repository == 'eclipse-tractusx/knowledge-agents' && github.ref == 'refs/heads/main' }}
uses: peter-evans/dockerhub-description@v3
with:
readme-filepath: conforming/README.md
readme-filepath: conforming/README.md
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: ${{ env.IMAGE_NAMESPACE }}/conforming-agent
Expand All @@ -146,7 +145,7 @@ jobs:
with:
images: |
${{ env.IMAGE_NAMESPACE }}/remoting-agent
# Automatically prepare image tags; See action docs for more examples.
# Automatically prepare image tags; See action docs for more examples.
# semver patter will generate tags like these for example :1 :1.2 :1.2.3
tags: |
type=sha,event=branch
Expand All @@ -173,7 +172,7 @@ jobs:
if: ${{ github.repository == 'eclipse-tractusx/knowledge-agents' && github.ref == 'refs/heads/main' }}
uses: peter-evans/dockerhub-description@v3
with:
readme-filepath: remoting/README.md
readme-filepath: remoting/README.md
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: ${{ env.IMAGE_NAMESPACE }}/remoting-agent
Expand All @@ -185,7 +184,7 @@ jobs:
with:
images: |
${{ env.IMAGE_NAMESPACE }}/provisioning-agent
# Automatically prepare image tags; See action docs for more examples.
# Automatically prepare image tags; See action docs for more examples.
# semver patter will generate tags like these for example :1 :1.2 :1.2.3
tags: |
type=sha,event=branch
Expand All @@ -212,8 +211,8 @@ jobs:
if: ${{ github.repository == 'eclipse-tractusx/knowledge-agents' && github.ref == 'refs/heads/main' }}
uses: peter-evans/dockerhub-description@v3
with:
readme-filepath: provisioning/README.md
readme-filepath: provisioning/README.md
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: ${{ env.IMAGE_NAMESPACE }}/provisioning-agent

8 changes: 4 additions & 4 deletions .github/workflows/helm-chart-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ on:
push:
branches:
- main
- 'releases/**'
- 'release/*'
paths:
- .github/workflows/**
- charts/**
pull_request:
branches:
- main
- 'releases/**'
- 'release/*'
paths:
- .github/workflows/**
- charts/**
Expand Down Expand Up @@ -76,12 +76,12 @@ jobs:
uses: helm/[email protected]

- name: Run chart-testing (lint)
run: ct lint --target-branch ${{ github.event.repository.default_branch }} --config charts/config/chart-testing-config.yaml
run: ct lint --target-branch ${{ github.base_ref || github.ref_name }} --config charts/config/chart-testing-config.yaml

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
changed=$(ct list-changed --target-branch ${{ github.base_ref || github.ref_name }})
if [[ -n "$changed" ]]; then
echo "CHART_CHANGED=true" >> $GITHUB_ENV
fi
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/helm-chart-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,14 @@ name: Release Charts
on:
# May be invoked manually
workflow_dispatch:
branches:
- main
- 'releases/**'
# Or by pushing to the chart dir of some dev/ release branch
push:
# prevent unnecessary GH action runs for files outside of charts folder
paths:
- 'charts/**'
branches:
- main
- 'releases/**'
- 'release/*'

jobs:
release:
Expand Down Expand Up @@ -60,4 +57,4 @@ jobs:
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
4 changes: 2 additions & 2 deletions .github/workflows/kics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ on:
push:
branches:
- main
- 'releases/**'
- 'release/*'
pull_request:
branches:
- main
- 'releases/**'
- 'release/*'

workflow_dispatch:

Expand Down

0 comments on commit 671ec82

Please sign in to comment.