Skip to content

generate-pipelines

generate-pipelines #23

name: Generate GoCD Pipelines
on:
push:
paths:
- "pipelines/**/values.yaml"
- "templates/gocd/templates/deploy.yaml"
repository_dispatch:
types: [generate-pipelines]
jobs:
generate-pipelines:
runs-on: ubuntu-latest
concurrency:
group: app-pipeline-group-${{ github.event.client_payload.appName }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Generate GoCD pipeline files
run: |
BASE_PATH="pipelines"
CHART_PATH="templates/gocd"
for SERVICE in $(ls "$BASE_PATH"); do
VALUES_FILE="./$BASE_PATH/$SERVICE/values.yaml"
OUTPUT_FILE="./$BASE_PATH/$SERVICE/$SERVICE-pipeline.gocd.yaml"
helm template $SERVICE $CHART_PATH -f $VALUES_FILE | tee $OUTPUT_FILE
done
- name: Commit and push changes
run: |
git config user.name "in-jun"
git config user.email "[email protected]"
git add .
git commit -m "Update GoCD pipeline files"
git push