recreate ci cluster #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: recreate ci cluster | |
on: | |
workflow_dispatch: | |
env: | |
azure_resource_group: contrast-ci | |
jobs: | |
recreate: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- uses: ./.github/actions/setup_nix | |
with: | |
githubToken: ${{ secrets.GITHUB_TOKEN }} | |
cachixToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
- name: Login to Azure | |
uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # v2.1.1 | |
with: | |
creds: ${{ secrets.CONTRAST_CI_INFRA_AZURE }} | |
- name: Cleanup .azure dir | |
run: | | |
rm $HOME/.azure/{commandIndex.json,versionCheck.json} | |
- name: Destroy existing CI cluster | |
continue-on-error: true | |
run: | | |
nix run .#scripts.destroy-coco-aks -- --name="$azure_resource_group" | |
- name: Create CI cluster | |
run: | | |
nix run .#scripts.create-coco-aks -- --name="$azure_resource_group" | |
- name: Deploy sync server | |
run: | | |
kubectl apply -f https://raw.githubusercontent.com/katexochen/sync/f069648d8d08951b503559bab367036290d1f50a/server/deployment.yml | |
kubectl wait --for=condition=available --timeout=5m deployment/sync | |
- name: Get sync server IP | |
run: | | |
kubectl wait --for=jsonpath='{.status.loadBalancer.ingress[0].ip}' --timeout=5m svc/sync | |
SYNC_IP=$(kubectl get svc sync -o jsonpath='{.status.loadBalancer.ingress[0].ip}') | |
echo "SYNC_IP=$SYNC_IP" | tee -a "$GITHUB_ENV" | |
- name: Create fifo | |
run: | | |
fifoUUID=$(curl -fsSL http://$SYNC_IP:8080/fifo/new | jq -r '.uuid') | |
echo "Fifo UUID: $fifoUUID" | |
kubectl create configmap sync-server-fifo --from-literal=uuid=$fifoUUID |