|
| 1 | +--- |
| 2 | +name: Create per-chart branches |
| 3 | + |
| 4 | +# We only run this job on the charts that will be later moved to full blown charts |
| 5 | +# We also want to run the subtree comand only for the charts that have been actually changed |
| 6 | +# because git subtree split is a bit of an expensive operation |
| 7 | +# github actions do not support yaml anchors so there is more duplication than usual |
| 8 | +on: |
| 9 | + push: |
| 10 | + branches: |
| 11 | + - main |
| 12 | + paths: |
| 13 | + - 'acm/**' |
| 14 | + - 'golang-external-secrets/**' |
| 15 | + - 'hashicorp-vault/**' |
| 16 | + - 'letsencrypt/**' |
| 17 | + - 'clustergroup/**' |
| 18 | + |
| 19 | +jobs: |
| 20 | + changes: |
| 21 | + name: Figure out per-chart changes |
| 22 | + if: github.repository == 'validatedpatterns/common' |
| 23 | + runs-on: ubuntu-latest |
| 24 | + permissions: read-all |
| 25 | + outputs: |
| 26 | + acm: ${{ steps.filter.outputs.acm }} |
| 27 | + golang-external-secrets: ${{ steps.filter.outputs.golang-external-secrets }} |
| 28 | + hashicorp-vault: ${{ steps.filter.outputs.hashicorp-vault }} |
| 29 | + letsencrypt: ${{ steps.filter.outputs.letsencrypt }} |
| 30 | + clustergroup: ${{ steps.filter.outputs.clustergroup }} |
| 31 | + steps: |
| 32 | + - name: Checkout Code |
| 33 | + uses: actions/checkout@v4 |
| 34 | + |
| 35 | + - uses: dorny/paths-filter@v3 |
| 36 | + id: filter |
| 37 | + with: |
| 38 | + filters: | |
| 39 | + acm: |
| 40 | + - 'acm/**' |
| 41 | + golang-external-secrets: |
| 42 | + - 'golang-external-secrets/**' |
| 43 | + hashicorp-vault: |
| 44 | + - 'hashicorp-vault/**' |
| 45 | + letsencrypt: |
| 46 | + - 'letsencrypt/**' |
| 47 | + clustergroup: |
| 48 | + - 'clustergroup/**' |
| 49 | +
|
| 50 | + acm: |
| 51 | + needs: changes |
| 52 | + if: | |
| 53 | + ${{ needs.changes.outputs.acm == 'true' }} && |
| 54 | + github.repository == 'validatedpatterns/common' |
| 55 | + uses: validatedpatterns/common/.github/workflows/chart-split.yml@main |
| 56 | + permissions: |
| 57 | + actions: write |
| 58 | + contents: write |
| 59 | + with: |
| 60 | + chart_name: acm |
| 61 | + target_repository: validatedpatterns/acm-chart |
| 62 | + secrets: inherit |
| 63 | + |
| 64 | + golang-external-secrets: |
| 65 | + needs: changes |
| 66 | + if: | |
| 67 | + ${{ needs.changes.outputs.golang-external-secrets == 'true' }} && |
| 68 | + github.repository == 'validatedpatterns/common' |
| 69 | + uses: validatedpatterns/common/.github/workflows/chart-split.yml@main |
| 70 | + permissions: |
| 71 | + actions: write |
| 72 | + contents: write |
| 73 | + with: |
| 74 | + chart_name: golang-external-secrets |
| 75 | + target_repository: validatedpatterns/golang-external-secrets-chart |
| 76 | + secrets: inherit |
| 77 | + |
| 78 | + hashicorp-vault: |
| 79 | + needs: changes |
| 80 | + if: | |
| 81 | + ${{ needs.changes.outputs.hashicorp-vault == 'true' }} && |
| 82 | + github.repository == 'validatedpatterns/common' |
| 83 | + uses: validatedpatterns/common/.github/workflows/chart-split.yml@main |
| 84 | + permissions: |
| 85 | + actions: write |
| 86 | + contents: write |
| 87 | + with: |
| 88 | + chart_name: hashicorp-vault |
| 89 | + target_repository: validatedpatterns/hashicorp-vault-chart |
| 90 | + secrets: inherit |
| 91 | + |
| 92 | + letsencrypt: |
| 93 | + needs: changes |
| 94 | + if: | |
| 95 | + ${{ needs.changes.outputs.letsencrypt == 'true' }} && |
| 96 | + github.repository == 'validatedpatterns/common' |
| 97 | + uses: validatedpatterns/common/.github/workflows/chart-split.yml@main |
| 98 | + permissions: |
| 99 | + actions: write |
| 100 | + contents: write |
| 101 | + with: |
| 102 | + chart_name: letsencrypt |
| 103 | + target_repository: validatedpatterns/letsencrypt-chart |
| 104 | + secrets: inherit |
| 105 | + |
| 106 | + clustergroup: |
| 107 | + needs: changes |
| 108 | + if: | |
| 109 | + ${{ needs.changes.outputs.clustergroup == 'true' }} && |
| 110 | + github.repository == 'validatedpatterns/common' |
| 111 | + uses: validatedpatterns/common/.github/workflows/chart-split.yml@main |
| 112 | + permissions: |
| 113 | + actions: write |
| 114 | + contents: write |
| 115 | + with: |
| 116 | + chart_name: clustergroup |
| 117 | + target_repository: validatedpatterns/clustergroup-chart |
| 118 | + secrets: inherit |
0 commit comments