mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
ci: 🧠
This commit is contained in:
parent
f5d7891eff
commit
2e4069a728
1 changed files with 28 additions and 45 deletions
73
.github/workflows/charts-release.yaml
vendored
73
.github/workflows/charts-release.yaml
vendored
|
@ -11,18 +11,22 @@ on:
|
|||
- "charts/**"
|
||||
|
||||
jobs:
|
||||
collect-changes:
|
||||
release-charts:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
outputs:
|
||||
changesDetected: ${{ steps.filter.outputs.chartsAddedOrModified }}
|
||||
addedOrModifiedCharts: ${{ steps.filter-charts.outputs.addedOrModifiedCharts }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
- name: Get k8s-at-home token
|
||||
id: get-app-token
|
||||
uses: getsentry/action-github-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.BJWS_APP_ID }}
|
||||
private_key: ${{ secrets.BJWS_APP_PRIVATE_KEY }}
|
||||
|
||||
- name: Checkout charts branch
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
token: ${{ steps.get-app-token.outputs.token }}
|
||||
path: 'src'
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Collect changes
|
||||
uses: dorny/paths-filter@v2
|
||||
|
@ -31,7 +35,7 @@ jobs:
|
|||
list-files: shell
|
||||
filters: |
|
||||
chartsAddedOrModified:
|
||||
- added|modified: 'charts/*/**'
|
||||
- added|modified: 'src/charts/*/**'
|
||||
|
||||
- name: Collect changed charts
|
||||
if: |
|
||||
|
@ -52,27 +56,6 @@ jobs:
|
|||
# Set output to changed charts
|
||||
printf "::set-output name=addedOrModifiedCharts::%s\n" "${CHARTS[*]}"
|
||||
|
||||
release-charts:
|
||||
runs-on: ubuntu-22.04
|
||||
needs:
|
||||
- collect-changes
|
||||
if:
|
||||
needs.collect-changes.outputs.changesDetected == 'true'
|
||||
steps:
|
||||
- name: Get k8s-at-home token
|
||||
id: get-app-token
|
||||
uses: getsentry/action-github-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.BJWS_APP_ID }}
|
||||
private_key: ${{ secrets.BJWS_APP_PRIVATE_KEY }}
|
||||
|
||||
- name: Checkout charts branch
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
token: ${{ steps.get-app-token.outputs.token }}
|
||||
path: 'src'
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Checkout gh-pages branch
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
|
@ -89,7 +72,7 @@ jobs:
|
|||
env:
|
||||
SRC_DIR: "src/charts"
|
||||
DEST_DIR: "dest"
|
||||
CHARTS: "${{ needs.collect-changes.outputs.addedOrModifiedCharts }}"
|
||||
CHARTS: "${{ steps.filter-charts.outputs.addedOrModifiedCharts }}"
|
||||
run: |
|
||||
for CHART in $CHARTS ; do
|
||||
mapfile -t CHART_PATH_PARTS < <(echo "$CHART" | tr '/' '\n')
|
||||
|
@ -99,19 +82,19 @@ jobs:
|
|||
helm package "$CHART" -u -d "$DEST_DIR/$CHART_TYPE"
|
||||
done
|
||||
|
||||
- name: Create new index
|
||||
shell: bash
|
||||
working-directory: dest
|
||||
run: |
|
||||
helm repo index . --url https://bjw-s.github.io/helm-charts/
|
||||
# - name: Create new index
|
||||
# shell: bash
|
||||
# working-directory: dest
|
||||
# run: |
|
||||
# helm repo index . --url https://bjw-s.github.io/helm-charts/
|
||||
|
||||
- name: Push changes
|
||||
shell: bash
|
||||
working-directory: dest
|
||||
run: |
|
||||
git config user.name "bjw-s-bot[bot]"
|
||||
git config user.email "bjw-s-bot <87358111+bjw-s-bot[bot]@users.noreply.github.com>"
|
||||
git add $(git ls-files -o --exclude-standard)
|
||||
git add index.yaml
|
||||
git commit -m "Updated from ref: $GITHUB_SHA"
|
||||
git push
|
||||
# - name: Push changes
|
||||
# shell: bash
|
||||
# working-directory: dest
|
||||
# run: |
|
||||
# git config user.name "bjw-s-bot[bot]"
|
||||
# git config user.email "bjw-s-bot <87358111+bjw-s-bot[bot]@users.noreply.github.com>"
|
||||
# git add $(git ls-files -o --exclude-standard)
|
||||
# git add index.yaml
|
||||
# git commit -m "Updated from ref: $GITHUB_SHA"
|
||||
# git push
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue