Skip to content

deploy fuelwatch evidence website #50

deploy fuelwatch evidence website

deploy fuelwatch evidence website #50

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}}