From 20a8c689e87fac447d179c2ddc71093d527290e3 Mon Sep 17 00:00:00 2001 From: Bryce Coon Date: Tue, 16 Apr 2024 10:15:16 -0600 Subject: [PATCH] adding database backup --- .github/workflows/backup-database.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/backup-database.yml diff --git a/.github/workflows/backup-database.yml b/.github/workflows/backup-database.yml new file mode 100644 index 0000000..20c1974 --- /dev/null +++ b/.github/workflows/backup-database.yml @@ -0,0 +1,14 @@ +name: backup database +on: + - workflow_dispatch +jobs: + backup: + runs-on: self-hosted + steps: + - name: backup + run: | + CONTAINER_NAME=$(kubectl -n bryce2 get pods --no-headers -o custom-columns=":metadata.name" | grep "blazor-web-db-deployment") + kubectl -n bryce2 exec -t $CONTAINER_NAME -- \ + pg_dumpall -c -U postgres \ + > /home/bryce/dump.sql + \ No newline at end of file