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 28, 2024
1 parent 7ec5792 commit b87ab8d
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/pre-pull-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
pull-requests: write
strategy:
matrix:
images: ${{ steps.extract-images.outputs.images }}
paths: ${{ fromJSON(needs.changed-clusters.outputs.matrix) }}
max-parallel: 4
fail-fast: false
Expand All @@ -91,9 +92,6 @@ jobs:
app-id: ${{ env.BOT_APP_ID }}
private-key: ${{ env.BOT_APP_PRIVATE_KEY }}

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

- name: Setup mise
uses: jdx/mise-action@v2
with:
Expand Down Expand Up @@ -157,16 +155,35 @@ jobs:
echo "${images}" | jq --raw-output 'to_entries[] | "* \(.value)"' >> $GITHUB_STEP_SUMMARY
pre-pull-images:
if: ${{ needs.extract-images.outputs.matrix != '[]' }}
if: ${{ needs.extract-images.outputs.images != '[]' }}
name: Pre-pull Images
runs-on: ["gha-runner-scale-set"]
needs: ["extract-images"]
strategy:
matrix:
images: ${{ fromJSON(needs.extract-images.outputs.matrix) }}
images: ${{ fromJSON(needs.extract-images.outputs.images) }}
paths: ${{ fromJSON(needs.extract-images.outputs.paths) }}
max-parallel: 4
fail-fast: false
steps:
- name: Grab Cluster Name
run: |
cluster="${{ matrix.paths }}"
cluster="${cluster/kubernetes\//}"
echo "cluster=${cluster^^}" >> $GITHUB_ENV
- name: Configure 1password
uses: 1password/load-secrets-action/configure@v2
with:
service-account-token: ${{ secrets.ONEPASS_SA_TOKEN }}

- name: Get Secrets
uses: 1password/load-secrets-action@v2
with:
export-env: true
env:
TALOSCONFIG: op://Kubernetes/kubernetes/TALOSCONFIG_${{ env.cluster }}

- name: Setup mise
uses: jdx/mise-action@v2
with:
Expand Down

0 comments on commit b87ab8d

Please sign in to comment.