Skip to content

Commit

Permalink
feat: make job into multi-cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
joryirving committed Dec 29, 2024
1 parent bdeccc6 commit cbf7a53
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 30 deletions.
36 changes: 21 additions & 15 deletions .github/workflows/pre-pull-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ name: "Pre-pull Images"
on:
pull_request:
branches: ["main"]
paths: ["kubernetes/**"]
paths:
- kubernetes/**/apps/**
- kubernetes/**/flux/**
- kubernetes/shared/**

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
Expand Down Expand Up @@ -70,7 +73,7 @@ jobs:
fail-fast: false
outputs:
images: ${{ steps.extract-images.outputs.images }}
paths: ${{ fromJSON(needs.changed-clusters.outputs.matrix) }}
paths: ${{ needs.changed-clusters.outputs.matrix }}
steps:
- name: Configure 1password
uses: 1password/load-secrets-action/configure@v2
Expand All @@ -92,12 +95,12 @@ jobs:
app-id: ${{ env.BOT_APP_ID }}
private-key: ${{ env.BOT_APP_PRIVATE_KEY }}

- name: Setup mise
uses: jdx/mise-action@v2
with:
mise_toml: |
[tools]
"aqua:mikefarah/yq" = "latest"
- name: Setup Homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Setup Workflow Tools
shell: bash
run: brew install jo yq

- name: Checkout Default Branch
uses: actions/checkout@v4
Expand Down Expand Up @@ -184,15 +187,18 @@ jobs:
env:
TALOSCONFIG: op://Kubernetes/kubernetes/TALOSCONFIG_${{ env.cluster }}

- name: Setup mise
uses: jdx/mise-action@v2
with:
mise_toml: |
[tools]
"aqua:siderolabs/talos" = "latest"
- name: Setup Homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Setup Workflow Tools
shell: bash
run: brew install siderolabs/tap/talosctl

- name: Pre-pull Image
run: talosctl -n $NODE_IP image pull ${{ matrix.images }}
run: |
talosctl get disks
NODE=$(talosctl config info --output json | jq --raw-output '.nodes[]' | shuf -n 1)
talosctl -n $NODE image pull ${{ matrix.images }}
# Summarize matrix https://github.community/t/status-check-for-a-matrix-jobs/127354/7
pre-pull-images-success:
Expand Down
23 changes: 8 additions & 15 deletions .github/workflows/schemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
env:
BOT_APP_ID: op://Kubernetes/github-bot/BOT_APP_ID
BOT_APP_PRIVATE_KEY: op://Kubernetes/github-bot/BOT_APP_PRIVATE_KEY
KUBECONFIG: op://Kubernetes/kubernetes/KUBECONFIG_BASE64
KUBECONFIG: op://Kubernetes/kubernetes/KUBECONFIG
CLOUDFLARE_API_TOKEN: op://Kubernetes/cloudflare/CLOUDFLARE_API_TOKEN_GHA
CLOUDFLARE_ACCOUNT_ID: op://Kubernetes/cloudflare/CLOUDFLARE_ACCOUNT_TAG

Expand All @@ -46,12 +46,12 @@ jobs:
with:
token: ${{ steps.app-token.outputs.token }}

- name: Setup mise
uses: jdx/mise-action@v2
with:
mise_toml: |
[tools]
"aqua:kubernetes/kubectl" = "latest"
- name: Setup Homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Setup Workflow Tools
shell: bash
run: brew install kubectl

- name: Setup Python
uses: actions/setup-python@v5
Expand All @@ -63,16 +63,9 @@ jobs:
with:
node-version: 18.x

- name: Write kubeconfig
id: kubeconfig
uses: timheuer/base64-to-file@v1
with:
encodedString: ${{ env.KUBECONFIG }}
fileName: kubeconfig

- name: Download and run crd-extractor
env:
KUBECONFIG: ${{ steps.kubeconfig.outputs.filePath }}
KUBECONFIG: ${{ env.KUBECONFIG }}
shell: bash
run: |
curl -fsSL -o $GITHUB_WORKSPACE/crd-extractor.sh \
Expand Down

0 comments on commit cbf7a53

Please sign in to comment.