Skip to content

Commit

Permalink
add: test k8s
Browse files Browse the repository at this point in the history
  • Loading branch information
boxp committed Dec 9, 2024
1 parent 3a1d24b commit 8ca5741
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/k8s-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: test k8s
on:
push:
branches:
- '**'

permissions:
id-token: write
contents: read

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Authenticate with Cloudflare
run: |
ID_TOKEN=$(curl -H "Metadata-Flavor: Google" \
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}" \
-X POST "https://YOUR-CLOUDFLARE-API-ENDPOINT/tokens" \
--data '{ "claims": { "sub": "repo:boxp/lolice:ref:refs/heads/*" } }')
echo "ID_TOKEN=$ID_TOKEN" >> $GITHUB_ENV
- name: Call the Kubernetes API
run: |
curl -H "Authorization: Bearer $ID_TOKEN" \
-X GET "https://k8s.b0xp.io/api/v1/namespaces/default/pods"

0 comments on commit 8ca5741

Please sign in to comment.