-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (114 loc) · 3.98 KB
/
run.yml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Build the digital-land database
on:
schedule:
- cron: 0 5 * * *
workflow_dispatch: null
env:
DLB_BOT_EMAIL: ${{ secrets.DLB_BOT_EMAIL }}
DLB_BOT_TOKEN: ${{ secrets.DLB_BOT_TOKEN }}
DLB_BOT_USERNAME: ${{ secrets.DLB_BOT_USERNAME }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Free up disk space
run: |
df -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
echo
df -h
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Configure git
run: |
git config user.email "${DLB_BOT_EMAIL}"
git config user.name "${DLB_BOT_USERNAME}"
git remote set-url origin https://${DLB_BOT_USERNAME}:${DLB_BOT_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git checkout ${GITHUB_REF_NAME}
- name: Update makerules
run: make makerules
- name: Commit updated makerules
run: make commit-makerules
- name: Install dependencies
run: make init
- name: Clobber dataset
run: make clobber
- name: Build dataset
run: make
# Development
- name: Configure Development AWS Credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{secrets.DEVELOPMENT_AWS_ACCESS_KEY_ID}}
aws-secret-access-key: ${{secrets.DEVELOPMENT_AWS_ACCESS_SECRET}}
aws-region: eu-west-2
- name: Save datasets to Development S3
env:
COLLECTION_DATASET_BUCKET_NAME: ${{secrets.DEVELOPMENT_DATA_S3_BUCKET}}
HOISTED_COLLECTION_DATASET_BUCKET_NAME: ${{secrets.DEVELOPMENT_DATA_S3_BUCKET}}
run: make save-dataset
# Staging
- name: Configure Staging AWS Credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{secrets.STAGING_AWS_ACCESS_KEY_ID}}
aws-secret-access-key: ${{secrets.STAGING_AWS_ACCESS_SECRET}}
aws-region: eu-west-2
- name: Save datasets to Staging S3
env:
COLLECTION_DATASET_BUCKET_NAME: ${{secrets.STAGING_DATA_S3_BUCKET}}
HOISTED_COLLECTION_DATASET_BUCKET_NAME: ${{secrets.STAGING_DATA_S3_BUCKET}}
run: make save-dataset
# Production
- name: Configure Production AWS Credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{secrets.PROD_AWS_ACCESS_KEY_ID}}
aws-secret-access-key: ${{secrets.PROD_AWS_ACCESS_SECRET}}
aws-region: eu-west-2
- name: Save datasets to Prod S3
env:
COLLECTION_DATASET_BUCKET_NAME: ${{secrets.PRODUCTION_DATA_S3_BUCKET}}
HOISTED_COLLECTION_DATASET_BUCKET_NAME: ${{secrets.PRODUCTION_DATA_S3_BUCKET}}
run: make save-dataset
check-digital-land-builder-errors:
runs-on: ubuntu-latest
needs:
- build
if: always() && contains(join(needs.*.result, ','), 'failure')
steps:
- name: send failure notification
uses: slackapi/slack-github-action@v1
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
channel-id: 'planning-data-platform'
payload: |
{
"text": "Digital Land Builder Has Failed",
"icon_emoji": ":warning:",
"username": "DigitalLandBuilder",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "Digital Land Builder Has Failed"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "The report is available on <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|GitHub>"
}
}
]
}