Skip to content

Commit

Permalink
feat: workflows back to brew and docker
Browse files Browse the repository at this point in the history
Signed-off-by: Devin Buhl <[email protected]>
  • Loading branch information
onedr0p committed Dec 31, 2024
1 parent e536f3d commit 1f69996
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 91 deletions.
41 changes: 16 additions & 25 deletions .github/workflows/flux-diff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

env:
HOMEBREW_NO_ANALYTICS: "1"
UV_SYSTEM_PYTHON: "1"

jobs:
flux-diff:
name: Flux Diff
Expand Down Expand Up @@ -46,32 +50,19 @@ jobs:
ref: "${{ github.event.repository.default_branch }}"
path: default

- name: Setup Workflow Tools
uses: jdx/mise-action@v2
env:
GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}"
with:
mise_toml: |
[tools]
python = "latest"
"aqua:astral-sh/uv" = "latest"
"aqua:fluxcd/flux2" = "latest"
"aqua:helm/helm" = "latest"
"aqua:kubernetes-sigs/kustomize" = "latest"
"pipx:flux-local" = "latest"
- name: Diff Resources
shell: bash
run: |
flux-local diff ${{ matrix.resources }} \
--unified 6 \
--path ${{ github.workspace }}/pull/kubernetes/main/flux \
--path-orig ${{ github.workspace }}/default/kubernetes/main/flux \
--strip-attrs "helm.sh/chart,checksum/config,app.kubernetes.io/version,chart" \
--limit-bytes 10000 \
--all-namespaces \
--sources "home-kubernetes" \
--output-file diff.patch
uses: docker://ghcr.io/allenporter/flux-local:v6.1.1@sha256:3196af20e76a73149be83dc21b63a51e86d3c1fbb2764c2acb5f72d057484344
with:
args: >-
diff ${{ matrix.resources }}
--unified 6
--path /github/workspace/pull/kubernetes/main/flux
--path-orig /github/workspace/default/kubernetes/main/flux
--strip-attrs "helm.sh/chart,checksum/config,app.kubernetes.io/version,chart"
--limit-bytes 10000
--all-namespaces
--sources "home-kubernetes"
--output-file diff.patch
- name: Generate Diff
id: diff
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/helm-repository-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ on:
branches: ["main"]
paths: ["kubernetes/**/helmrelease.yaml"]

env:
HOMEBREW_NO_ANALYTICS: "1"

jobs:
sync:
name: Helm Repository Sync
Expand All @@ -34,15 +37,12 @@ jobs:
token: "${{ steps.app-token.outputs.token }}"
fetch-depth: 0

- name: Setup Homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Setup Workflow Tools
uses: jdx/mise-action@v2
env:
GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}"
with:
mise_toml: |
[tools]
"aqua:fluxcd/flux2" = "latest"
"aqua:mikefarah/yq" = "latest"
shell: bash
run: brew install fluxcd/tap/flux yq

- if: ${{ github.event.inputs.helmRepoNamespace == '' && github.event.inputs.helmRepoName == '' }}
name: Get Changed Files
Expand Down
76 changes: 25 additions & 51 deletions .github/workflows/pre-pull-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

env:
HOMEBREW_NO_ANALYTICS: "1"
UV_SYSTEM_PYTHON: "1"

jobs:
default-images:
name: Default Images
Expand All @@ -34,29 +38,15 @@ jobs:
token: "${{ steps.app-token.outputs.token }}"
ref: "${{ github.event.repository.default_branch }}"

- name: Setup Workflow Tools
uses: jdx/mise-action@v2
env:
GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}"
with:
mise_toml: |
[tools]
python = "latest"
"aqua:astral-sh/uv" = "latest"
"aqua:fluxcd/flux2" = "latest"
"aqua:helm/helm" = "latest"
"aqua:kubernetes-sigs/kustomize" = "latest"
"aqua:mikefarah/yq" = "latest"
"pipx:flux-local" = "latest"
- name: Gather Images
shell: bash
run: |
flux-local get cluster \
--path ${{ github.workspace }}/kubernetes/main/flux \
--enable-images \
--output yaml \
--output-file images.yaml
uses: docker://ghcr.io/allenporter/flux-local:v6.1.1@sha256:3196af20e76a73149be83dc21b63a51e86d3c1fbb2764c2acb5f72d057484344
with:
args: >-
get cluster
--path /github/workspace/kubernetes/main/flux
--enable-images
--output yaml
--output-file images.yaml
- name: Filter Images
shell: bash
Expand Down Expand Up @@ -89,29 +79,15 @@ jobs:
with:
token: "${{ steps.app-token.outputs.token }}"

- name: Setup Workflow Tools
uses: jdx/mise-action@v2
env:
GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}"
with:
mise_toml: |
[tools]
python = "latest"
"aqua:astral-sh/uv" = "latest"
"aqua:fluxcd/flux2" = "latest"
"aqua:helm/helm" = "latest"
"aqua:kubernetes-sigs/kustomize" = "latest"
"aqua:mikefarah/yq" = "latest"
"pipx:flux-local" = "latest"
- name: Gather Images
shell: bash
run: |
flux-local get cluster \
--path ${{ github.workspace }}/kubernetes/main/flux \
--enable-images \
--output yaml \
--output-file images.yaml
uses: docker://ghcr.io/allenporter/flux-local:v6.1.1@sha256:3196af20e76a73149be83dc21b63a51e86d3c1fbb2764c2acb5f72d057484344
with:
args: >-
get cluster
--path /github/workspace/kubernetes/main/flux
--enable-images
--output yaml
--output-file images.yaml
- name: Filter Images
shell: bash
Expand Down Expand Up @@ -162,14 +138,12 @@ jobs:
app-id: "${{ secrets.BOT_APP_ID }}"
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"

- name: Setup Homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Setup Workflow Tools
uses: jdx/mise-action@v2
env:
GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}"
with:
mise_toml: |
[tools]
"aqua:siderolabs/talos" = "latest"
shell: bash
run: brew install siderolabs/tap/talosctl

- name: Pre-pull Image
run: talosctl -n $NODE_IP image pull ${{ matrix.images }}
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/schemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
push:
branches: ["main"]
paths: [".github/workflows/schemas.yaml"]
pull_request:
branches: ["main"]
paths: [".github/workflows/schemas.yaml"]

env:
HOMEBREW_NO_ANALYTICS: "1"
Expand All @@ -34,13 +37,8 @@ jobs:
with:
token: "${{ steps.app-token.outputs.token }}"

# TODO: Integrate Mise Action
# - The use of kubectl in a subshell in the crd-extractor script doesn't work
# - Does not play nice with wrangler-action
- name: Setup Homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
stable: true

- name: Setup Workflow Tools
shell: bash
Expand All @@ -49,12 +47,12 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12.x
python-version: 3.13.x

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
node-version: 22.x

- name: Install Python Dependencies
run: uv pip install pyyaml
Expand Down

0 comments on commit 1f69996

Please sign in to comment.