From d70908b03330505945676d26068dcf5e6bd6268b Mon Sep 17 00:00:00 2001 From: Luca Vari Date: Fri, 29 Nov 2024 12:06:13 +1100 Subject: [PATCH] Don't update staging from production as often as it's not necessary We don't need to update so often and this reduces the use of the minutes per month we have access to free for GitHub actions (2000 at the time of writing). See https://docs.github.com/en/billing/managing-billing-for-your-products/managing-billing-for-github-actions/about-billing-for-github-actions#included-storage-and-minutes --- .github/workflows/backup.yml | 10 ---------- .github/workflows/staging.yml | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/staging.yml diff --git a/.github/workflows/backup.yml b/.github/workflows/backup.yml index e3a71019..27bc960c 100644 --- a/.github/workflows/backup.yml +++ b/.github/workflows/backup.yml @@ -12,15 +12,5 @@ jobs: - name: Run backup script run: ./infra/backup.sh shell: bash - env: - CLERK_PRIVATE_SSH_KEY: ${{ secrets.CLERK_PRIVATE_SSH_KEY }} - update_staging: - runs-on: ubuntu-latest - needs: backup - steps: - - uses: actions/checkout@v4 - - name: Run backup script - run: ./infra/staging/database-restore.sh - shell: bash env: CLERK_PRIVATE_SSH_KEY: ${{ secrets.CLERK_PRIVATE_SSH_KEY }} \ No newline at end of file diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml new file mode 100644 index 00000000..42a48d07 --- /dev/null +++ b/.github/workflows/staging.yml @@ -0,0 +1,16 @@ +name: Staging +on: + workflow_dispatch: + schedule: + # Update staging environment at 0415 AEST (18:15 UTC) each Saturday + - cron: "15 18 * * SAT" +jobs: + update_staging: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run backup script + run: ./infra/staging/database-restore.sh + shell: bash + env: + CLERK_PRIVATE_SSH_KEY: ${{ secrets.CLERK_PRIVATE_SSH_KEY }} \ No newline at end of file