-
Notifications
You must be signed in to change notification settings - Fork 4
68 lines (67 loc) · 2.61 KB
/
on-schedule-backup-prod.yml
File metadata and controls
68 lines (67 loc) · 2.61 KB
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
59
60
61
62
63
64
65
66
67
68
name: PROD - Database backup
on:
schedule:
- cron: '0 7,19 * * *' # Twice a day: 7am and 7pm UTC
workflow_dispatch:
jobs:
crn-contentful:
runs-on: ubuntu-latest
container:
image: ghcr.io/yldio/asap-hub/node-python-sq:86a189edc900d4e1afdcf3935c697292f69d409b
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
environment: Production
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Re-Build
uses: ./.github/actions/build-rebuild
- name: Cache build typecheck output
uses: ./.github/actions/cache-unplugged
with:
environment-name: Production
- name: Setup
id: setup
uses: ./.github/actions/setup-environment
with:
environment-name: Production
- name: Build
run: yarn exec "yarn workspaces foreach -vptR --from '{@asap-hub/asap-cli,@asap-hub/crn-server}' run build:babel"
- name: Backup
uses: ./.github/actions/contentful-backup
with:
app: 'crn'
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
bucket-name: ${{ steps.setup.outputs.crn-contentful-backup-bucket-name }}
contentful-space-id: ${{ steps.setup.outputs.crn-contentful-space-id }}
contentful-environment: ${{ steps.setup.outputs.contentful-environment }}
contentful-token: ${{ secrets.CONTENTFUL_MANAGEMENT_TOKEN }}
data-bucket-name: ${{ steps.setup.outputs.crn-data-backup-bucket-name }}
gp2-contentful:
runs-on: ubuntu-latest
container:
image: ghcr.io/yldio/asap-hub/node-python-sq:86a189edc900d4e1afdcf3935c697292f69d409b
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
environment: Production
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
id: setup
uses: ./.github/actions/setup-environment
with:
environment-name: Production
- name: Backup
uses: ./.github/actions/contentful-backup
with:
app: 'gp2'
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
bucket-name: ${{ steps.setup.outputs.gp2-contentful-backup-bucket-name }}
contentful-space-id: ${{ steps.setup.outputs.gp2-contentful-space-id }}
contentful-environment: ${{ steps.setup.outputs.contentful-environment }}
contentful-token: ${{ secrets.CONTENTFUL_MANAGEMENT_TOKEN }}