Skip to content

Commit 7df7899

Browse files
build: Limit paths each workflow runs. Autoformat github workflow yaml. (#44)
1 parent 16a21f2 commit 7df7899

3 files changed

Lines changed: 97 additions & 88 deletions

File tree

.github/workflows/doc-build.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ name: documentation-build
55
on:
66
push:
77
branches:
8-
- '**'
8+
- "**"
99
tags:
10-
- 'docs-v*.*.*'
10+
- "docs-v*.*.*"
11+
paths:
12+
- "docs/**"
13+
- ".github/workflows/doc-build**"
1114
release:
1215
types: [published]
1316

.github/workflows/kubernetes-charts-build.yaml

Lines changed: 56 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ name: Kubernetes - Lint, Test, and Publish Helm Charts
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
tags:
7-
- 'helm-charts-v*.*.*' # e.g., helm-charts-v0.1.1
7+
- "helm-charts-v*.*.*" # e.g., helm-charts-v0.1.1
8+
paths:
9+
- "deployment/kubernetes/charts/**"
10+
- ".github/workflows/kubernetes-charts-build**"
811
pull_request:
912
paths:
10-
- 'deployment/kubernetes/charts/**'
11-
- '.github/workflows/kubernetes**'
13+
- "deployment/kubernetes/charts/**"
14+
- ".github/workflows/kubernetes**"
1215

1316
defaults:
1417
run:
@@ -29,7 +32,7 @@ jobs:
2932

3033
- uses: actions/setup-python@v6.0.0
3134
with:
32-
python-version: '3.x'
35+
python-version: "3.x"
3336
check-latest: true
3437

3538
- name: Set up chart-testing
@@ -68,51 +71,51 @@ jobs:
6871
env:
6972
DEFAULT_CHART_VERSION: 0.0.1
7073
steps:
71-
- name: Log in to Docker Hub
72-
uses: docker/login-action@v1
73-
with:
74-
username: ${{ secrets.DOCKERHUB_USERNAME }}
75-
password: ${{ secrets.DOCKERHUB_TOKEN }}
76-
77-
- name: Set up Helm
78-
uses: azure/setup-helm@v4.2.0
79-
with:
80-
version: v3.17.0
81-
82-
- name: Checkout
83-
uses: actions/checkout@v5
84-
85-
- name: Determine version
86-
id: version
87-
run: |
88-
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
89-
# Strip the tag prefix helm-charts-v
90-
CHART_VERSION="${GITHUB_REF_NAME#helm-charts-v}"
91-
else
92-
CHART_VERSION="$DEFAULT_CHART_VERSION"
93-
fi
94-
echo "chart_version=$CHART_VERSION" >> "$GITHUB_OUTPUT"
95-
96-
- name: Package Helm Charts
97-
# TODO: List the dir instead of hardcoding each one
98-
run: |
99-
helm package ./charts/medcat-service-helm --version ${{ steps.version.outputs.chart_version }}
100-
helm package ./charts/medcat-trainer-helm --version ${{ steps.version.outputs.chart_version }} --dependency-update
101-
helm package ./charts/cogstack-helm-ce --version ${{ steps.version.outputs.chart_version }} --dependency-update
102-
103-
- name: Helm OCI login to Docker Hub
104-
run: helm registry login registry-1.docker.io -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
105-
106-
- name: Push Helm Chart to Docker Hub OCI
107-
run: |
108-
helm push ./medcat-service-helm-${{ steps.version.outputs.chart_version }}.tgz oci://registry-1.docker.io/cogstacksystems
109-
helm push ./medcat-trainer-helm-${{ steps.version.outputs.chart_version }}.tgz oci://registry-1.docker.io/cogstacksystems
110-
helm push ./cogstack-helm-ce-${{ steps.version.outputs.chart_version }}.tgz oci://registry-1.docker.io/cogstacksystems
111-
112-
- name: Release
113-
uses: softprops/action-gh-release@v2
114-
if: github.ref_type == 'tag'
115-
with:
116-
draft: true
117-
files: |
118-
./deployment/kubernetes/*.tgz
74+
- name: Log in to Docker Hub
75+
uses: docker/login-action@v1
76+
with:
77+
username: ${{ secrets.DOCKERHUB_USERNAME }}
78+
password: ${{ secrets.DOCKERHUB_TOKEN }}
79+
80+
- name: Set up Helm
81+
uses: azure/setup-helm@v4.2.0
82+
with:
83+
version: v3.17.0
84+
85+
- name: Checkout
86+
uses: actions/checkout@v5
87+
88+
- name: Determine version
89+
id: version
90+
run: |
91+
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
92+
# Strip the tag prefix helm-charts-v
93+
CHART_VERSION="${GITHUB_REF_NAME#helm-charts-v}"
94+
else
95+
CHART_VERSION="$DEFAULT_CHART_VERSION"
96+
fi
97+
echo "chart_version=$CHART_VERSION" >> "$GITHUB_OUTPUT"
98+
99+
- name: Package Helm Charts
100+
# TODO: List the dir instead of hardcoding each one
101+
run: |
102+
helm package ./charts/medcat-service-helm --version ${{ steps.version.outputs.chart_version }}
103+
helm package ./charts/medcat-trainer-helm --version ${{ steps.version.outputs.chart_version }} --dependency-update
104+
helm package ./charts/cogstack-helm-ce --version ${{ steps.version.outputs.chart_version }} --dependency-update
105+
106+
- name: Helm OCI login to Docker Hub
107+
run: helm registry login registry-1.docker.io -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
108+
109+
- name: Push Helm Chart to Docker Hub OCI
110+
run: |
111+
helm push ./medcat-service-helm-${{ steps.version.outputs.chart_version }}.tgz oci://registry-1.docker.io/cogstacksystems
112+
helm push ./medcat-trainer-helm-${{ steps.version.outputs.chart_version }}.tgz oci://registry-1.docker.io/cogstacksystems
113+
helm push ./cogstack-helm-ce-${{ steps.version.outputs.chart_version }}.tgz oci://registry-1.docker.io/cogstacksystems
114+
115+
- name: Release
116+
uses: softprops/action-gh-release@v2
117+
if: github.ref_type == 'tag'
118+
with:
119+
draft: true
120+
files: |
121+
./deployment/kubernetes/*.tgz

.github/workflows/observability-docker.yml

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,24 @@ name: ci-build
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
tags:
7-
- 'v*.*.*' # e.g., v0.1.1
7+
- "v*.*.*" # e.g., v0.1.1
8+
paths:
9+
- "observability/**"
10+
- ".github/workflows/observability**"
811
pull_request:
912
paths:
10-
- 'observability/**'
11-
- '.github/workflows/observability**'
13+
- "observability/**"
14+
- ".github/workflows/observability**"
1215

1316
jobs:
1417
docker:
1518
runs-on: ubuntu-latest
1619
if: github.event.pull_request.user.login != 'dependabot[bot]' && github.repository == 'CogStack/cogstack-platform-toolkit'
1720
strategy:
1821
matrix: # This should be replaced with Docker Bake instead
19-
include:
22+
include:
2023
- name: prometheus
2124
context: observability/prometheus
2225
dockerfile: observability/prometheus/Dockerfile.prometheus
@@ -26,7 +29,7 @@ jobs:
2629
dockerfile: observability/prometheus/Dockerfile.blackbox
2730
image: cogstacksystems/cogstack-observability-blackbox-exporter
2831
- name: grafana
29-
context: observability/grafana
32+
context: observability/grafana
3033
dockerfile: observability/grafana/Dockerfile
3134
image: cogstacksystems/cogstack-observability-grafana
3235
- name: traefik
@@ -79,31 +82,31 @@ jobs:
7982
test-observability-quickstart-scripts:
8083
runs-on: ubuntu-latest
8184
name: Test observability Quickstart scripts
82-
85+
8386
steps:
84-
- name: Checkout repository
85-
uses: actions/checkout@v4
86-
87-
- name: Set up Python
88-
uses: actions/setup-python@v4
89-
with:
90-
python-version: '3.9'
91-
cache: pip
92-
93-
- name: Install Python dependencies
94-
run: pip install -r observability/test/requirements.txt
95-
96-
- name: Run Simple quickstart test
97-
run: |
98-
echo "🧪 Running Simple quickstart test..."
99-
bash observability/test/test-quickstart.sh
100-
101-
- name: Report test result
102-
if: always()
103-
run: |
104-
if [ $? -eq 0 ]; then
105-
echo "✅ quickstart test PASSED"
106-
else
107-
echo "❌ quickstart test FAILED"
108-
exit 1
109-
fi
87+
- name: Checkout repository
88+
uses: actions/checkout@v4
89+
90+
- name: Set up Python
91+
uses: actions/setup-python@v4
92+
with:
93+
python-version: "3.9"
94+
cache: pip
95+
96+
- name: Install Python dependencies
97+
run: pip install -r observability/test/requirements.txt
98+
99+
- name: Run Simple quickstart test
100+
run: |
101+
echo "🧪 Running Simple quickstart test..."
102+
bash observability/test/test-quickstart.sh
103+
104+
- name: Report test result
105+
if: always()
106+
run: |
107+
if [ $? -eq 0 ]; then
108+
echo "✅ quickstart test PASSED"
109+
else
110+
echo "❌ quickstart test FAILED"
111+
exit 1
112+
fi

0 commit comments

Comments
 (0)