Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: workflows back to brew and docker #8585

Merged
merged 8 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 12 additions & 25 deletions .github/workflows/flux-diff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,32 +46,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 = "3.12"
"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

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

env:
HOMEBREW_NO_ANALYTICS: "1"

jobs:
default-images:
name: Default Images
Expand All @@ -34,29 +37,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 = "3.12"
"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 +78,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 = "3.12"
"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 +137,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
9 changes: 2 additions & 7 deletions .github/workflows/schemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,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 +44,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
Loading