From f763db206b47f2546d1e690fa60a010a289f94aa Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Wed, 1 Feb 2023 20:02:22 -0500 Subject: [PATCH] ci: add workflow options to nightly db build --- .github/workflows/dev-db-nightly.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev-db-nightly.yml b/.github/workflows/dev-db-nightly.yml index 9a2284d4d..99a4af569 100644 --- a/.github/workflows/dev-db-nightly.yml +++ b/.github/workflows/dev-db-nightly.yml @@ -23,12 +23,23 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: + inputs: + skipMariaDBBuild: + description: 'Skip MariaDB Build' + default: false + required: true + type: boolean + exportDumpAsSQL: + description: 'Save PostgreSQL Debug Dump' + default: false + required: true + type: boolean jobs: build-mariadb: name: Build MariaDB Docker Images runs-on: ubuntu-latest - if: ${{ github.ref == 'refs/heads/main' }} + if: ${{ github.ref == 'refs/heads/main' && github.event.inputs.skipMariaDBBuild == 'false' }} permissions: contents: read packages: write @@ -96,6 +107,7 @@ jobs: name: Migrate MySQL to PostgreSQL DB runs-on: ubuntu-latest container: ghcr.io/ietf-tools/datatracker-app-base:latest + if: ${{ always() && !failure() }} needs: [combine-mariadb] permissions: contents: read @@ -141,6 +153,17 @@ jobs: with: name: dump path: ietf.dump + + - name: Export as SQL (Debug) + if: ${{ github.event.inputs.exportDumpAsSQL == 'true' }} + run: pg_dump -h pgdb -U django ietf > ietf.sql + + - name: Upload SQL DB Dump (Debug) + if: ${{ github.event.inputs.exportDumpAsSQL == 'true' }} + uses: actions/upload-artifact@v3 + with: + name: dumpsql + path: ietf.sql build: name: Build PostgreSQL Docker Images