Skip to content

Commit

Permalink
Use GitHub Actions to ping the preview database
Browse files Browse the repository at this point in the history
Hopefully this makes it so Aiven don't think it is not being used.
  • Loading branch information
dentarg committed Jan 23, 2025
1 parent 5fca0ad commit c70c5b8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Cron

on:
schedule:
- cron: "0 6 * * 6" # 06:00 every Saturday
workflow_dispatch:

jobs:
preview-psql:
runs-on: ubuntu-latest
env:
PREVIEW_DATABASE_URL: "${{ secrets.PREVIEW_DATABASE_URL }}"
steps:
- run: psql --command='SELECT version();' $PREVIEW_DATABASE_URL
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ fly secrets set --detach --app wikimum-preview DATABASE_URL="$(pbpaste)"
fly secrets set --detach --app wikimum-preview SESSION_SECRET="$(pbpaste)"
```

To keep the preview database (at Aiven) from being removed prematurely, GitHub Actions has been configured with the `cron.yml` workflow and this secret:

```bash
gh secret --repo Starkast/wikimum set PREVIEW_DATABASE_URL --body "$(pbpaste)"
```

## Code Scanning

GitHub Actions scan the code using [Brakeman](https://github.com/presidentbeef/brakeman).
Expand Down

0 comments on commit c70c5b8

Please sign in to comment.