-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (52 loc) · 1.99 KB
/
export.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: "Export OpenBeta Data"
on:
workflow_dispatch:
# schedule:
# - cron: "0 0 * * *" # Run every day at midnight
jobs:
export:
name: Export OpenBeta Data
runs-on: ubuntu-latest
steps:
- name: Add IP address to trusted source (managed database)
uses: GarreauArthur/manage-digital-ocean-managed-database-trusted-sources-gh-action@main
with:
action: "add"
database_id: ${{ secrets.DATABASE_ID }}
digitalocean_token: ${{ secrets.DIGITALOCEAN_TOKEN }}
- uses: actions/checkout@v3
name: Checkout openbeta-graphql
with:
name: openbeta/openbeta-graphql
ref: refs/heads/develop
path: openbeta-graphql
- uses: actions/checkout@v3
name: Checkout openbeta-export
with:
path: export
- name: Install dependencies
run: yarn install
- name: Export data
run: yarn export:json:full --output "$GITHUB_WORKSPACE/export/"
env:
MONGO_SCHEME: ${{ secrets.MONGO_SCHEME }}
MONGO_INITDB_ROOT_USERNAME: ${{ secrets.MONGO_INITDB_ROOT_USERNAME }}
MONGO_INITDB_ROOT_PASSWORD: ${{ secrets.MONGO_INITDB_ROOT_PASSWORD }}
MONGO_SERVICE: ${{ secrets.MONGO_SERVICE }}
MONGO_AUTHDB: ${{ secrets.MONGO_AUTHDB }}
MONGO_DBNAME: ${{ secrets.MONGO_DBNAME }}
MONGO_TLS: true
MONGO_READ_PREFERENCE: primary
MONGO_REPLICA_SET_NAME: ${{ secrets.MONGO_REPLICA_SET_NAME }}
- uses: EndBug/add-and-commit@v9
with:
author_name: OpenBeta Export
cwd: "$GITHUB_WORKSPACE/export/"
message: 'export openbeta data'
- name: Remove IP address from trusted source (managed database)
uses: GarreauArthur/manage-digital-ocean-managed-database-trusted-sources-gh-action@main
if: always()
with:
action: "remove"
database_id: ${{ secrets.DATABASE_ID }}
digitalocean_token: ${{ secrets.DIGITALOCEAN_TOKEN }}