-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (47 loc) · 1.29 KB
/
fuelwatch-deploy.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
name: deploy fuelwatch evidence website
on:
push:
branches:
- main
paths:
- pages/**/*
- data/**/*
- sources/**/*
- .github/workflows/*.yaml
schedule:
- cron: "30 6 * * *"
permissions:
contents: read
id-token: write
env:
DUCKDB_URL: https://github.com/duckdb/duckdb/releases/download/v1.0.0/duckdb_cli-linux-amd64.zip
jobs:
build-fuelwatch:
runs-on: ubuntu-latest
steps:
- name: Git clone the repository
uses: actions/checkout@v4
- name: download duckdb
run: |
curl -L ${DUCKDB_URL} -o duckdb.zip
unzip duckdb.zip -d duckdb
- name: make fuelwatch database
run: |
export PATH=$PATH:$PWD/duckdb
cd data
./get-data.sh
./make-db.sh ../sources/fuelwatch/fuelwatch.db
- name: build evidence site
run: |
npm ci
npm run sources
npm run build
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{vars.AWS_ASSUME_ROLE}}
role-session-name: github-actions
aws-region: ${{vars.AWS_DEPLOY_REGION}}
- name: sync bucket
run: |
aws s3 sync build/ s3://${{vars.AWS_DEPLOY_BUCKET}}