Skip to content

Commit

Permalink
Merge pull request #14 from ropable/master
Browse files Browse the repository at this point in the history
Merge long-outstanding changes from current prod
  • Loading branch information
ropable authored May 13, 2024
2 parents 1fac761 + 7e6d318 commit b37c2b8
Show file tree
Hide file tree
Showing 26 changed files with 321 additions and 217 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git
.gitignore
Dockerfile
LICENSE
README.md
91 changes: 91 additions & 0 deletions .github/workflows/image-build-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: "Build Docker image and run Trivy vulnerability scan"

on:
push:
# Publish `master` as `latest` image.
branches: [master]
# Publish `1.*` tags as releases.
tags: ['1.*']
pull_request:
branches: [master]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
name: Build Docker image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
security-events: write
steps:
#----------------------------------------------
# Checkout repo
#----------------------------------------------
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
#----------------------------------------------
# Set up Docker BuildX environment
#----------------------------------------------
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
#----------------------------------------------
# Log Docker into the GitHub Container Repository
#----------------------------------------------
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
#----------------------------------------------
# Extract Docker image metadata from GitHub events
#----------------------------------------------
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=true
#----------------------------------------------
# Build and push Docker image (not on PR)
#----------------------------------------------
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
scan:
name: Image vulnerability scan
runs-on: ubuntu-latest
needs: [build]
permissions:
contents: read
packages: read
security-events: write
steps:
#----------------------------------------------
# Run vulnerability scan on built image
#----------------------------------------------
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'image'
image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
vuln-type: 'os,library'
severity: 'HIGH,CRITICAL'
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM nginxinc/nginx-unprivileged:stable-alpine
MAINTAINER [email protected]
LABEL org.opencontainers.image.source https://github.com/dbca-wa/biodiversityaudit2

COPY . /usr/share/nginx/html
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,12 @@ Secondly, it serves as an example of summarising and visualising data from CKAN,
Section on hosting and configuration.

## Dependencies
Section on dependencies, e.g. datasets on CKAN.
Section on dependencies, e.g. datasets on CKAN.

## Development

Use e.g. python-livereload to host a hot-reloading local version.
```
pip install livereload
livereload -p 8001
```
Binary file added data/gis.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion data/ibra-min.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"SUB_CODE":"AVW01","SUB_NAME":"Merredin","REG_CODE":"AVW","REG_NAME":"Avon Wheatbelt"},{"SUB_CODE":"AVW02","SUB_NAME":"Katanning","REG_CODE":"AVW","REG_NAME":"Avon Wheatbelt"},{"SUB_CODE":"CAR01","SUB_NAME":"Cape Range","REG_CODE":"CAR","REG_NAME":"Carnarvon"},{"SUB_CODE":"CAR02","SUB_NAME":"Wooramel","REG_CODE":"CAR","REG_NAME":"Carnarvon"},{"SUB_CODE":"CEK01","SUB_NAME":"Pentecost","REG_CODE":"CEK","REG_NAME":"Central Kimberley"},{"SUB_CODE":"CEK02","SUB_NAME":"Hart","REG_CODE":"CEK","REG_NAME":"Central Kimberley"},{"SUB_CODE":"CEK03","SUB_NAME":"Mount Eliza","REG_CODE":"CEK","REG_NAME":"Central Kimberley"},{"SUB_CODE":"CER01","SUB_NAME":"Mann-Musgrave Block","REG_CODE":"CER","REG_NAME":"Central Ranges"},{"SUB_CODE":"COO01","SUB_NAME":"Mardabilla","REG_CODE":"COO","REG_NAME":"Coolgardie"},{"SUB_CODE":"COO02","SUB_NAME":"Southern Cross","REG_CODE":"COO","REG_NAME":"Coolgardie"},{"SUB_CODE":"COO03","SUB_NAME":"Eastern Goldfield","REG_CODE":"COO","REG_NAME":"Coolgardie"},{"SUB_CODE":"DAL01","SUB_NAME":"Fitzroy Trough","REG_CODE":"DAL","REG_NAME":"Dampierland"},{"SUB_CODE":"DAL02","SUB_NAME":"Pindanland","REG_CODE":"DAL","REG_NAME":"Dampierland"},{"SUB_CODE":"ESP01","SUB_NAME":"Fitzgerald","REG_CODE":"ESP","REG_NAME":"Esperance Plains"},{"SUB_CODE":"ESP02","SUB_NAME":"Recherche","REG_CODE":"ESP","REG_NAME":"Esperance Plains"},{"SUB_CODE":"GAS01","SUB_NAME":"Ashburton","REG_CODE":"GAS","REG_NAME":"Gascoyne"},{"SUB_CODE":"GAS02","SUB_NAME":"Carnegie","REG_CODE":"GAS","REG_NAME":"Gascoyne"},{"SUB_CODE":"GAS03","SUB_NAME":"Augustus","REG_CODE":"GAS","REG_NAME":"Gascoyne"},{"SUB_CODE":"GES01","SUB_NAME":"Geraldton Hills","REG_CODE":"GES","REG_NAME":"Geraldton Sandplains"},{"SUB_CODE":"GES02","SUB_NAME":"Lesueur Sandplain","REG_CODE":"GES","REG_NAME":"Geraldton Sandplains"},{"SUB_CODE":"GID01","SUB_NAME":"Lateritic Plain","REG_CODE":"GID","REG_NAME":"Gibson Desert"},{"SUB_CODE":"GID02","SUB_NAME":"Dune Field","REG_CODE":"GID","REG_NAME":"Gibson Desert"},{"SUB_CODE":"GSD01","SUB_NAME":"McLarty","REG_CODE":"GSD","REG_NAME":"Great Sandy Desert"},{"SUB_CODE":"GSD02","SUB_NAME":"Mackay","REG_CODE":"GSD","REG_NAME":"Great Sandy Desert"},{"SUB_CODE":"GVD01","SUB_NAME":"Shield","REG_CODE":"GVD","REG_NAME":"Great Victoria Desert"},{"SUB_CODE":"GVD02","SUB_NAME":"Central","REG_CODE":"GVD","REG_NAME":"Great Victoria Desert"},{"SUB_CODE":"GVD03","SUB_NAME":"Maralinga","REG_CODE":"GVD","REG_NAME":"Great Victoria Desert"},{"SUB_CODE":"GVD04","SUB_NAME":"Kintore","REG_CODE":"GVD","REG_NAME":"Great Victoria Desert"},{"SUB_CODE":"HAM01","SUB_NAME":"Hampton","REG_CODE":"HAM","REG_NAME":"Hampton"},{"SUB_CODE":"JAF01","SUB_NAME":"Northern Jarrah Forest","REG_CODE":"JAF","REG_NAME":"Jarrah Forest"},{"SUB_CODE":"JAF02","SUB_NAME":"Southern Jarrah Forest","REG_CODE":"JAF","REG_NAME":"Jarrah Forest"},{"SUB_CODE":"LSD01","SUB_NAME":"Rudall","REG_CODE":"LSD","REG_NAME":"Little Sandy Desert"},{"SUB_CODE":"LSD02","SUB_NAME":"Trainor","REG_CODE":"LSD","REG_NAME":"Little Sandy Desert"},{"SUB_CODE":"MAL01","SUB_NAME":"Eastern Mallee","REG_CODE":"MAL","REG_NAME":"Mallee"},{"SUB_CODE":"MAL02","SUB_NAME":"Western Mallee","REG_CODE":"MAL","REG_NAME":"Mallee"},{"SUB_CODE":"MUR01","SUB_NAME":"Eastern Murchison","REG_CODE":"MUR","REG_NAME":"Murchison"},{"SUB_CODE":"MUR02","SUB_NAME":"Western Murchison","REG_CODE":"MUR","REG_NAME":"Murchison"},{"SUB_CODE":"NOK01","SUB_NAME":"Mitchell","REG_CODE":"NOK","REG_NAME":"Northern Kimberley"},{"SUB_CODE":"NOK02","SUB_NAME":"Berkeley","REG_CODE":"NOK","REG_NAME":"Northern Kimberley"},{"SUB_CODE":"NUL01","SUB_NAME":"Carlisle","REG_CODE":"NUL","REG_NAME":"Nullarbor"},{"SUB_CODE":"NUL02","SUB_NAME":"Nullarbor Plain","REG_CODE":"NUL","REG_NAME":"Nullarbor"},{"SUB_CODE":"OVP01","SUB_NAME":"Purnululu","REG_CODE":"OVP","REG_NAME":"Ord Victoria Plain"},{"SUB_CODE":"OVP02","SUB_NAME":"South Kimberley Interzone","REG_CODE":"OVP","REG_NAME":"Ord Victoria Plain"},{"SUB_CODE":"PIL01","SUB_NAME":"Chichester","REG_CODE":"PIL","REG_NAME":"Pilbara"},{"SUB_CODE":"PIL02","SUB_NAME":"Fortescue","REG_CODE":"PIL","REG_NAME":"Pilbara"},{"SUB_CODE":"PIL03","SUB_NAME":"Hamersley","REG_CODE":"PIL","REG_NAME":"Pilbara"},{"SUB_CODE":"PIL04","SUB_NAME":"Roebourne","REG_CODE":"PIL","REG_NAME":"Pilbara"},{"SUB_CODE":"SWA01","SUB_NAME":"Dandaragan Plateau","REG_CODE":"SWA","REG_NAME":"Swan Coastal Plain"},{"SUB_CODE":"SWA02","SUB_NAME":"Perth","REG_CODE":"SWA","REG_NAME":"Swan Coastal Plain"},{"SUB_CODE":"TAN01","SUB_NAME":"Tanami Desert","REG_CODE":"TAN","REG_NAME":"Tanami"},{"SUB_CODE":"VIB01","SUB_NAME":"Keep","REG_CODE":"VIB","REG_NAME":"Victoria Bonaparte"},{"SUB_CODE":"WAR01","SUB_NAME":"Warren","REG_CODE":"WAR","REG_NAME":"Warren"},{"SUB_CODE":"YAL01","SUB_NAME":"Edel","REG_CODE":"YAL","REG_NAME":"Yalgoo"},{"SUB_CODE":"YAL02","SUB_NAME":"Tallering","REG_CODE":"YAL","REG_NAME":"Yalgoo"}]
[{"SUB_CODE":"AVW01","SUB_NAME":"Merredin","REG_CODE":"AVW","REG_NAME":"Avon Wheatbelt"},{"SUB_CODE":"AVW02","SUB_NAME":"Katanning","REG_CODE":"AVW","REG_NAME":"Avon Wheatbelt"},{"SUB_CODE":"CAR01","SUB_NAME":"Cape Range","REG_CODE":"CAR","REG_NAME":"Carnarvon"},{"SUB_CODE":"CAR02","SUB_NAME":"Wooramel","REG_CODE":"CAR","REG_NAME":"Carnarvon"},{"SUB_CODE":"CEK01","SUB_NAME":"Pentecost","REG_CODE":"CEK","REG_NAME":"Central Kimberley"},{"SUB_CODE":"CEK02","SUB_NAME":"Hart","REG_CODE":"CEK","REG_NAME":"Central Kimberley"},{"SUB_CODE":"CEK03","SUB_NAME":"Mount Eliza","REG_CODE":"CEK","REG_NAME":"Central Kimberley"},{"SUB_CODE":"CER01","SUB_NAME":"Mann-Musgrave Block","REG_CODE":"CER","REG_NAME":"Central Ranges"},{"SUB_CODE":"COO01","SUB_NAME":"Mardabilla","REG_CODE":"COO","REG_NAME":"Coolgardie"},{"SUB_CODE":"COO02","SUB_NAME":"Southern Cross","REG_CODE":"COO","REG_NAME":"Coolgardie"},{"SUB_CODE":"COO03","SUB_NAME":"Eastern Goldfield","REG_CODE":"COO","REG_NAME":"Coolgardie"},{"SUB_CODE":"DAL01","SUB_NAME":"Fitzroy Trough","REG_CODE":"DAL","REG_NAME":"Dampierland"},{"SUB_CODE":"DAL02","SUB_NAME":"Pindanland","REG_CODE":"DAL","REG_NAME":"Dampierland"},{"SUB_CODE":"ESP01","SUB_NAME":"Fitzgerald","REG_CODE":"ESP","REG_NAME":"Esperance Plains"},{"SUB_CODE":"ESP02","SUB_NAME":"Recherche","REG_CODE":"ESP","REG_NAME":"Esperance Plains"},{"SUB_CODE":"GAS01","SUB_NAME":"Ashburton","REG_CODE":"GAS","REG_NAME":"Gascoyne"},{"SUB_CODE":"GAS02","SUB_NAME":"Carnegie","REG_CODE":"GAS","REG_NAME":"Gascoyne"},{"SUB_CODE":"GAS03","SUB_NAME":"Augustus","REG_CODE":"GAS","REG_NAME":"Gascoyne"},{"SUB_CODE":"GES01","SUB_NAME":"Geraldton Hills","REG_CODE":"GES","REG_NAME":"Geraldton Sandplains"},{"SUB_CODE":"GES02","SUB_NAME":"Lesueur Sandplain","REG_CODE":"GES","REG_NAME":"Geraldton Sandplains"},{"SUB_CODE":"GID01","SUB_NAME":"Lateritic Plain","REG_CODE":"GID","REG_NAME":"Gibson Desert"},{"SUB_CODE":"GID02","SUB_NAME":"Dune Field","REG_CODE":"GID","REG_NAME":"Gibson Desert"},{"SUB_CODE":"GSD01","SUB_NAME":"McLarty","REG_CODE":"GSD","REG_NAME":"Great Sandy Desert"},{"SUB_CODE":"GSD02","SUB_NAME":"Mackay","REG_CODE":"GSD","REG_NAME":"Great Sandy Desert"},{"SUB_CODE":"GVD01","SUB_NAME":"Shield","REG_CODE":"GVD","REG_NAME":"Great Victoria Desert"},{"SUB_CODE":"GVD02","SUB_NAME":"Central","REG_CODE":"GVD","REG_NAME":"Great Victoria Desert"},{"SUB_CODE":"GVD03","SUB_NAME":"Maralinga","REG_CODE":"GVD","REG_NAME":"Great Victoria Desert"},{"SUB_CODE":"GVD04","SUB_NAME":"Kintore","REG_CODE":"GVD","REG_NAME":"Great Victoria Desert"},{"SUB_CODE":"HAM01","SUB_NAME":"Hampton","REG_CODE":"HAM","REG_NAME":"Hampton"},{"SUB_CODE":"JAF01","SUB_NAME":"Northern Jarrah Forest","REG_CODE":"JAF","REG_NAME":"Jarrah Forest"},{"SUB_CODE":"JAF02","SUB_NAME":"Southern Jarrah Forest","REG_CODE":"JAF","REG_NAME":"Jarrah Forest"},{"SUB_CODE":"LSD01","SUB_NAME":"Rudall","REG_CODE":"LSD","REG_NAME":"Little Sandy Desert"},{"SUB_CODE":"LSD02","SUB_NAME":"Trainor","REG_CODE":"LSD","REG_NAME":"Little Sandy Desert"},{"SUB_CODE":"MAL01","SUB_NAME":"Eastern Mallee","REG_CODE":"MAL","REG_NAME":"Mallee"},{"SUB_CODE":"MAL02","SUB_NAME":"Western Mallee","REG_CODE":"MAL","REG_NAME":"Mallee"},{"SUB_CODE":"MUR01","SUB_NAME":"Eastern Murchison","REG_CODE":"MUR","REG_NAME":"Murchison"},{"SUB_CODE":"MUR02","SUB_NAME":"Western Murchison","REG_CODE":"MUR","REG_NAME":"Murchison"},{"SUB_CODE":"NOK01","SUB_NAME":"Mitchell","REG_CODE":"NOK","REG_NAME":"Northern Kimberley"},{"SUB_CODE":"NOK02","SUB_NAME":"Berkeley","REG_CODE":"NOK","REG_NAME":"Northern Kimberley"},{"SUB_CODE":"NUL01","SUB_NAME":"Carlisle","REG_CODE":"NUL","REG_NAME":"Nullarbor"},{"SUB_CODE":"NUL02","SUB_NAME":"Nullarbor Plain","REG_CODE":"NUL","REG_NAME":"Nullarbor"},{"SUB_CODE":"OVP01","SUB_NAME":"Purnululu","REG_CODE":"OVP","REG_NAME":"Ord Victoria Plain"},{"SUB_CODE":"OVP02","SUB_NAME":"South Kimberley Interzone","REG_CODE":"OVP","REG_NAME":"Ord Victoria Plain"},{"SUB_CODE":"PIL01","SUB_NAME":"Chichester","REG_CODE":"PIL","REG_NAME":"Pilbara"},{"SUB_CODE":"PIL02","SUB_NAME":"Fortescue","REG_CODE":"PIL","REG_NAME":"Pilbara"},{"SUB_CODE":"PIL03","SUB_NAME":"Hamersley","REG_CODE":"PIL","REG_NAME":"Pilbara"},{"SUB_CODE":"PIL04","SUB_NAME":"Roebourne","REG_CODE":"PIL","REG_NAME":"Pilbara"},{"SUB_CODE":"PIL04","SUB_NAME":"Roebourne","REG_CODE":"PIL","REG_NAME":"Pilbara"},{"SUB_CODE":"SWA01","SUB_NAME":"Dandaragan Plateau","REG_CODE":"SWA","REG_NAME":"Swan Coastal Plain"},{"SUB_CODE":"SWA02","SUB_NAME":"Perth","REG_CODE":"SWA","REG_NAME":"Swan Coastal Plain"},{"SUB_CODE":"TAN01","SUB_NAME":"Tanami Desert","REG_CODE":"TAN","REG_NAME":"Tanami"},{"SUB_CODE":"VIB01","SUB_NAME":"Keep","REG_CODE":"VIB","REG_NAME":"Victoria Bonaparte"},{"SUB_CODE":"WAR01","SUB_NAME":"Warren","REG_CODE":"WAR","REG_NAME":"Warren"},{"SUB_CODE":"YAL01","SUB_NAME":"Edel","REG_CODE":"YAL","REG_NAME":"Yalgoo"},{"SUB_CODE":"YAL02","SUB_NAME":"Tallering","REG_CODE":"YAL","REG_NAME":"Yalgoo"}]
Loading

0 comments on commit b37c2b8

Please sign in to comment.