Skip to content

Commit

Permalink
fix(build): trigger build workflow on pushed tags
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianBezold authored and drcgjung committed Sep 1, 2023
1 parent e72d15b commit 57af488
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ on:
branches:
- main
- 'releases/**'
# 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:
Expand All @@ -35,13 +39,8 @@ on:
- '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

5 changes: 1 addition & 4 deletions .github/workflows/helm-chart-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ 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
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 }}"

0 comments on commit 57af488

Please sign in to comment.