smnorris Integrate roads workflow #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: integrate | |
run-name: ${{ github.actor }} Integrate roads workflow | |
on: | |
workflow_dispatch: | |
workflow_call: | |
env: | |
DATABASE_URL: ${{ vars.DATABASE_URL }} | |
AWS_ENDPOINT_URL: ${{ vars.AWS_ENDPOINT_URL }} | |
AWS_S3_ENDPOINT: ${{ vars.AWS_S3_ENDPOINT }} | |
AWS_VIRTUAL_HOSTING: ${{ vars.AWS_VIRTUAL_HOSTING }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
OBJECTSTORE_BUCKET: ${{ secrets.OBJECTSTORE_BUCKET }} | |
AWS_EC2_METADATA_DISABLED: ${{ vars.AWS_EC2_METADATA_DISABLED }} | |
CPL_VSISTDIN_BUFFER_LIMIT: ${{ vars.CPL_VSISTDIN_BUFFER_LIMIT }} | |
jobs: | |
get-matrix: | |
runs-on: ubuntu-latest | |
container: ghcr.io/bcgov/ce_integratedroads:main | |
environment: production | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- id: set-matrix | |
run: | | |
DATA=$(bcdata cat WHSE_BASEMAPPING.NTS_250K_GRID | jq -c '.properties | {map_tile: .MAP_TILE}' | tr '\n' ',') | |
echo "matrix={\"include\":[$DATA]}" >> $GITHUB_OUTPUT | |
integratedroads: | |
runs-on: ubuntu-latest | |
container: ghcr.io/bcgov/ce_integratedroads:main | |
environment: production | |
needs: get-matrix | |
strategy: | |
matrix: ${{fromJson(needs.get-matrix.outputs.matrix)}} | |
services: | |
postgres: | |
image: postgis/postgis:16-3.4 | |
env: | |
POSTGRES_PASSWORD: postgres | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: integrate | |
run: | | |
jobs/00_setup_db | |
jobs/06_integrate ${{ matrix.MAP_TILE }} |