Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 39 additions & 3 deletions .github/workflows/catalogue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
name: Shopstack DevSecOps Pipeline For Catalogue

on:
pull_request:
push:
branches:
- env/prod
paths:
Expand All @@ -18,7 +18,7 @@ permissions:

env:
PROJECT: "shopstack"
ENV: "staging"
ENV: "prod"

jobs:
build:
Expand Down Expand Up @@ -111,4 +111,40 @@ jobs:
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: ${{ matrix.component }}/Dockerfile
failure-threshold: warning
failure-threshold: warning

update-manifest:
name: "🚀 Update K8s Manifest"
runs-on: ubuntu-latest
needs: [build, image-scan, dockerfile-lint]
if: github.event_name == 'push' && github.ref == 'refs/heads/env/prod'
permissions:
contents: write # Needed to push manifest changes
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Get short SHA
id: sha
run: echo "short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Update K8s manifest with new image tags
run: |
git fetch origin
git checkout origin/k8s/prod

IMAGE_TAG=${{ steps.sha.outputs.short }}
sed -i 's/tag: .*/tag: ${IMAGE_TAG}/' helm/catalogue/values.yaml

echo "✅ Updated images to tag: ${IMAGE_TAG}"
grep "tag:" helm/catalogue/values.yaml

- name: Commit and push manifest update
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add helm/catalogue/values.yaml
git diff --cached --quiet || git commit -m "ci(${{ env.ENV }}): update helm catalogue values to ${{ steps.sha.outputs.short }} [skip ci]"
git push
42 changes: 39 additions & 3 deletions .github/workflows/dispatch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
name: Shopstack DevSecOps Pipeline For Dispatch

on:
pull_request:
push:
branches:
- env/prod
paths:
Expand All @@ -18,7 +18,7 @@ permissions:

env:
PROJECT: "shopstack"
ENV: "staging"
ENV: "prod"

jobs:
build:
Expand Down Expand Up @@ -111,4 +111,40 @@ jobs:
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: ${{ matrix.component }}/Dockerfile
failure-threshold: warning
failure-threshold: warning

update-manifest:
name: "🚀 Update K8s Manifest"
runs-on: ubuntu-latest
needs: [build, image-scan, dockerfile-lint]
if: github.event_name == 'push' && github.ref == 'refs/heads/env/prod'
permissions:
contents: write # Needed to push manifest changes
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Get short SHA
id: sha
run: echo "short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Update K8s manifest with new image tags
run: |
git fetch origin
git checkout origin/k8s/prod

IMAGE_TAG=${{ steps.sha.outputs.short }}
sed -i 's/tag: .*/tag: ${IMAGE_TAG}/' helm/dispatch/values.yaml

echo "✅ Updated images to tag: ${IMAGE_TAG}"
grep "tag:" helm/dispatch/values.yaml

- name: Commit and push manifest update
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add helm/dispatch/values.yaml
git diff --cached --quiet || git commit -m "ci(${{ env.ENV }}): update helm dispatch values to ${{ steps.sha.outputs.short }} [skip ci]"
git push
42 changes: 39 additions & 3 deletions .github/workflows/mongo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
name: Shopstack DevSecOps Pipeline For Mongo

on:
pull_request:
push:
branches:
- env/prod
paths:
Expand All @@ -18,7 +18,7 @@ permissions:

env:
PROJECT: "shopstack"
ENV: "staging"
ENV: "prod"

jobs:
build:
Expand Down Expand Up @@ -111,4 +111,40 @@ jobs:
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: ${{ matrix.component }}/Dockerfile
failure-threshold: warning
failure-threshold: warning

update-manifest:
name: "🚀 Update K8s Manifest"
runs-on: ubuntu-latest
needs: [build, image-scan, dockerfile-lint]
if: github.event_name == 'push' && github.ref == 'refs/heads/env/prod'
permissions:
contents: write # Needed to push manifest changes
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Get short SHA
id: sha
run: echo "short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Update K8s manifest with new image tags
run: |
git fetch origin
git checkout origin/k8s/prod

IMAGE_TAG=${{ steps.sha.outputs.short }}
sed -i 's/tag: .*/tag: ${IMAGE_TAG}/' helm/mongo/values.yaml

echo "✅ Updated images to tag: ${IMAGE_TAG}"
grep "tag:" helm/mongo/values.yaml

- name: Commit and push manifest update
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add helm/mongo/values.yaml
git diff --cached --quiet || git commit -m "ci(${{ env.ENV }}): update helm mongo values to ${{ steps.sha.outputs.short }} [skip ci]"
git push
42 changes: 39 additions & 3 deletions .github/workflows/mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
name: Shopstack DevSecOps Pipeline For Mysql

on:
pull_request:
push:
branches:
- env/prod
paths:
Expand All @@ -18,7 +18,7 @@ permissions:

env:
PROJECT: "shopstack"
ENV: "staging"
ENV: "prod"

jobs:
build:
Expand Down Expand Up @@ -111,4 +111,40 @@ jobs:
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: ${{ matrix.component }}/Dockerfile
failure-threshold: warning
failure-threshold: warning

update-manifest:
name: "🚀 Update K8s Manifest"
runs-on: ubuntu-latest
needs: [build, image-scan, dockerfile-lint]
if: github.event_name == 'push' && github.ref == 'refs/heads/env/prod'
permissions:
contents: write # Needed to push manifest changes
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Get short SHA
id: sha
run: echo "short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Update K8s manifest with new image tags
run: |
git fetch origin
git checkout origin/k8s/prod

IMAGE_TAG=${{ steps.sha.outputs.short }}
sed -i 's/tag: .*/tag: ${IMAGE_TAG}/' helm/mysql/values.yaml

echo "✅ Updated images to tag: ${IMAGE_TAG}"
grep "tag:" helm/mysql/values.yaml

- name: Commit and push manifest update
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add helm/mysql/values.yaml
git diff --cached --quiet || git commit -m "ci(${{ env.ENV }}): update helm mysql values to ${{ steps.sha.outputs.short }} [skip ci]"
git push
42 changes: 39 additions & 3 deletions .github/workflows/payment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
name: Shopstack DevSecOps Pipeline For Payment

on:
pull_request:
push:
branches:
- env/prod
paths:
Expand All @@ -18,7 +18,7 @@ permissions:

env:
PROJECT: "shopstack"
ENV: "staging"
ENV: "prod"

jobs:
build:
Expand Down Expand Up @@ -111,4 +111,40 @@ jobs:
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: ${{ matrix.component }}/Dockerfile
failure-threshold: warning
failure-threshold: warning

update-manifest:
name: "🚀 Update K8s Manifest"
runs-on: ubuntu-latest
needs: [build, image-scan, dockerfile-lint]
if: github.event_name == 'push' && github.ref == 'refs/heads/env/prod'
permissions:
contents: write # Needed to push manifest changes
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Get short SHA
id: sha
run: echo "short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Update K8s manifest with new image tags
run: |
git fetch origin
git checkout origin/k8s/prod

IMAGE_TAG=${{ steps.sha.outputs.short }}
sed -i 's/tag: .*/tag: ${IMAGE_TAG}/' helm/payment/values.yaml

echo "✅ Updated images to tag: ${IMAGE_TAG}"
grep "tag:" helm/payment/values.yaml

- name: Commit and push manifest update
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add helm/payment/values.yaml
git diff --cached --quiet || git commit -m "ci(${{ env.ENV }}): update helm payment values to ${{ steps.sha.outputs.short }} [skip ci]"
git push
42 changes: 39 additions & 3 deletions .github/workflows/ratings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
name: Shopstack DevSecOps Pipeline For Ratings

on:
pull_request:
push:
branches:
- env/prod
paths:
Expand All @@ -18,7 +18,7 @@ permissions:

env:
PROJECT: "shopstack"
ENV: "staging"
ENV: "prod"

jobs:
build:
Expand Down Expand Up @@ -111,4 +111,40 @@ jobs:
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: ${{ matrix.component }}/Dockerfile
failure-threshold: warning
failure-threshold: warning

update-manifest:
name: "🚀 Update K8s Manifest"
runs-on: ubuntu-latest
needs: [build, image-scan, dockerfile-lint]
if: github.event_name == 'push' && github.ref == 'refs/heads/env/prod'
permissions:
contents: write # Needed to push manifest changes
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Get short SHA
id: sha
run: echo "short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Update K8s manifest with new image tags
run: |
git fetch origin
git checkout origin/k8s/prod

IMAGE_TAG=${{ steps.sha.outputs.short }}
sed -i 's/tag: .*/tag: ${IMAGE_TAG}/' helm/ratings/values.yaml

echo "✅ Updated images to tag: ${IMAGE_TAG}"
grep "tag:" helm/ratings/values.yaml

- name: Commit and push manifest update
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add helm/ratings/values.yaml
git diff --cached --quiet || git commit -m "ci(${{ env.ENV }}): update helm ratings values to ${{ steps.sha.outputs.short }} [skip ci]"
git push
Loading