-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating artifact-update workflow to run only when the file changes (#…
…759)
- Loading branch information
Showing
1 changed file
with
31 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,19 +4,37 @@ on: | |
pull_request: | ||
branches: | ||
- 'main' | ||
paths: | ||
- '.github/workflows/update-artifacts.yml' | ||
- 'charts/tfy-k8s-aws-eks-inframold/**' | ||
- 'charts/tfy-k8s-azure-aks-inframold/**' | ||
- 'charts/tfy-k8s-civo-talos-inframold/**' | ||
- 'charts/tfy-k8s-gcp-gke-standard-inframold/**' | ||
- 'charts/tfy-k8s-generic-inframold/**' | ||
- 'scripts/generate-artifacts-manifest/**' | ||
- 'scripts/upload-artifacts/**' | ||
|
||
|
||
|
||
jobs: | ||
path-filter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
- name: Check if the following files changed | ||
uses: dorny/paths-filter@v3 | ||
id: path_filtering | ||
with: | ||
filters: | | ||
pathsrc: | ||
- '.github/workflows/update-artifacts.yml' | ||
- 'charts/tfy-k8s-aws-eks-inframold/**' | ||
- 'charts/tfy-k8s-azure-aks-inframold/**' | ||
- 'charts/tfy-k8s-civo-talos-inframold/**' | ||
- 'charts/tfy-k8s-gcp-gke-standard-inframold/**' | ||
- 'charts/tfy-k8s-generic-inframold/**' | ||
- 'scripts/generate-artifacts-manifest/**' | ||
- 'scripts/upload-artifacts/**' | ||
outputs: | ||
pathsrc_output: ${{ steps.path_filtering.outputs.pathsrc}} == 'true' | ||
|
||
update-artifacts: | ||
runs-on: ubuntu-latest | ||
needs: path-filter | ||
permissions: | ||
contents: write | ||
env: | ||
|
@@ -26,7 +44,7 @@ jobs: | |
ARTIFACTORY_HELM_REGISTRY_URL: ${{ vars.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_HELM_REGISTRY }} | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.head_ref }} | ||
|
@@ -47,12 +65,14 @@ jobs: | |
python-version: '3.10' | ||
|
||
- name: Install python dependencies | ||
if: needs.path-filter.outputs.pathsrc_output == 'true' | ||
run: | | ||
pip install -r scripts/upload-artifacts/requirements.txt | ||
pip install -r scripts/generate-artifacts-manifest/requirements.txt | ||
# Generate artifacts manifest for inframold charts | ||
- name: Generate Artifacts Manifest for Each Chart | ||
if: needs.path-filter.outputs.pathsrc_output == 'true' | ||
run: | | ||
charts_list=("tfy-k8s-aws-eks-inframold" "tfy-k8s-azure-aks-inframold" "tfy-k8s-gcp-gke-standard-inframold" "tfy-k8s-generic-inframold") | ||
for chart in "${charts_list[@]}"; | ||
|
@@ -66,6 +86,7 @@ jobs: | |
|
||
# Update the inframold artifacts manifest | ||
- name: Update Artifacts Manifest | ||
if: needs.path-filter.outputs.pathsrc_output == 'true' | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
|