Skip to content

Commit

Permalink
Merge pull request #3577 from mathesar-foundation/action_reset_demo
Browse files Browse the repository at this point in the history
Add GH workflow to reset demo
  • Loading branch information
pavish committed May 10, 2024
2 parents b4de3de + 78d674b commit 3e27342
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/reset-demo.yml
@@ -0,0 +1,51 @@
name: Reset demo

on:
push:
branches:
- master
workflow_dispatch:
schedule:
- cron: '1,9,17,30,45 6,7,8 * * *'


env:
PROJECT_ID: ${{ secrets.GKE_PROJECT_ID }}
GKE_CLUSTER: mathesar-demo
GKE_ZONE: us-central1


jobs:
reset:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: GCP login
uses: 'google-github-actions/auth@v0'
with:
credentials_json: '${{ secrets.GKE_DEMO_RESET_SA_KEY }}'

- name: Set up GKE credentials
uses: 'google-github-actions/get-gke-credentials@v0'
with:
cluster_name: ${{ env.GKE_CLUSTER }}
location: ${{ env.GKE_ZONE }}

- name: Delete existing demo deployment
run: kubectl delete deployments.apps demo-serve

- name: Wait until all pods are removed
run: >-
attempts=10
until [ $attempts -le 0 ] || [ -z "$(kubectl get pods)" ]; do
sleep 5
attempts=$((attempts - 1))
done
if [ $attempts -le 0 ]; then
return 1
fi
- name: Deploy demo
run: kubectl apply -f ./kubernetes_manifests/mathesar-demo.yml

0 comments on commit 3e27342

Please sign in to comment.