mirror of
https://github.com/auricom/home-cluster.git
synced 2025-09-29 13:24:29 +02:00
🚑 flux workflows
This commit is contained in:
40
.github/workflows/flux-diff.yaml
vendored
40
.github/workflows/flux-diff.yaml
vendored
@@ -5,54 +5,20 @@ name: "Flux Diff"
|
||||
on:
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
paths: ["kubernetes/apps/**"]
|
||||
paths: ["kubernetes/**"]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
changed-files:
|
||||
name: Changed Files
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.changed-files.outputs.all_changed_and_modified_files }}
|
||||
steps:
|
||||
- name: Generate Token
|
||||
uses: actions/create-github-app-token@v1
|
||||
id: app-token
|
||||
with:
|
||||
app-id: "${{ secrets.BOT_APP_ID }}"
|
||||
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
|
||||
|
||||
- name: Checkout Default Branch
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: "${{ steps.app-token.outputs.token }}"
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get Changed Files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v41
|
||||
with:
|
||||
files: kubernetes/**
|
||||
dir_names: true
|
||||
dir_names_max_depth: 2
|
||||
json: true
|
||||
escape_json: false
|
||||
|
||||
- name: List All Changed Files
|
||||
run: echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}"
|
||||
|
||||
flux-diff:
|
||||
name: Flux Diff
|
||||
runs-on: ubuntu-latest
|
||||
needs: ["changed-files"]
|
||||
permissions:
|
||||
pull-requests: write
|
||||
strategy:
|
||||
matrix:
|
||||
paths: ${{ fromJSON(needs.changed-files.outputs.matrix) }}
|
||||
resources: ["helmrelease", "kustomization"]
|
||||
max-parallel: 4
|
||||
fail-fast: false
|
||||
@@ -88,8 +54,8 @@ jobs:
|
||||
--log-level DEBUG
|
||||
diff ${{ matrix.resources }}
|
||||
--unified 6
|
||||
--path-orig /github/workspace/default/${{ matrix.paths }}
|
||||
--path /github/workspace/pull/${{ matrix.paths }}
|
||||
--path-orig /github/workspace/default/kubernetes
|
||||
--path /github/workspace/pull/kubernetes
|
||||
--strip-attrs "helm.sh/chart,checksum/config,app.kubernetes.io/version,chart"
|
||||
--limit-bytes 10000
|
||||
--all-namespaces
|
||||
|
44
.github/workflows/flux-image-test.yaml
vendored
44
.github/workflows/flux-image-test.yaml
vendored
@@ -5,56 +5,18 @@ name: "Flux Image Test"
|
||||
on:
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
paths: ["kubernetes/apps/**"]
|
||||
paths: ["kubernetes/**"]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
changed-files:
|
||||
name: Changed Files
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.changed-files.outputs.all_changed_and_modified_files }}
|
||||
steps:
|
||||
- name: Generate Token
|
||||
uses: actions/create-github-app-token@v1
|
||||
id: app-token
|
||||
with:
|
||||
app-id: "${{ secrets.BOT_APP_ID }}"
|
||||
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
|
||||
|
||||
- name: Checkout Default Branch
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: "${{ steps.app-token.outputs.token }}"
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get Changed Files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v41
|
||||
with:
|
||||
files: kubernetes/**
|
||||
dir_names: true
|
||||
dir_names_max_depth: 2
|
||||
json: true
|
||||
escape_json: false
|
||||
|
||||
- name: List All Changed Files
|
||||
run: echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}"
|
||||
|
||||
extract-images:
|
||||
name: Extract Images
|
||||
runs-on: ubuntu-latest
|
||||
needs: ["changed-files"]
|
||||
permissions:
|
||||
pull-requests: write
|
||||
strategy:
|
||||
matrix:
|
||||
paths: ${{ fromJSON(needs.changed-files.outputs.matrix) }}
|
||||
max-parallel: 4
|
||||
fail-fast: false
|
||||
outputs:
|
||||
matrix: ${{ steps.extract-images.outputs.images }}
|
||||
steps:
|
||||
@@ -96,7 +58,7 @@ jobs:
|
||||
with:
|
||||
args: >-
|
||||
get cluster
|
||||
--path /github/workspace/default/${{ matrix.paths }}
|
||||
--path /github/workspace/default/kubernetes
|
||||
--enable-images
|
||||
--output yaml
|
||||
--output-file default.yaml
|
||||
@@ -106,7 +68,7 @@ jobs:
|
||||
with:
|
||||
args: >-
|
||||
get cluster
|
||||
--path /github/workspace/pull/${{ matrix.paths }}
|
||||
--path /github/workspace/pull/kubernetes
|
||||
--enable-images
|
||||
--output yaml
|
||||
--output-file pull.yaml
|
||||
|
Reference in New Issue
Block a user