Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GH workflow to reset demo #3577

Merged
merged 2 commits into from
May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/reset-demo.yml
Original file line number Diff line number Diff line change
@@ -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
Loading