-
-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3577 from mathesar-foundation/action_reset_demo
Add GH workflow to reset demo
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
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
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 |