Skip to content

Commit

Permalink
add cdbg build and test to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
damonmcc committed Dec 31, 2024
1 parent a0783ae commit 98167a6
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
options:
- template
- cbbr
- cdbg
- checkbook
- colp
- cpdb
Expand Down Expand Up @@ -128,6 +129,17 @@ jobs:
logging_level: ${{ inputs.logging_level }}
build_note: ${{ inputs.build_note }}
dev_bucket: ${{ inputs.dev_bucket && format('de-dev-{0}', inputs.dev_bucket) || '' }}
cdbg:
needs: health_check
if: inputs.dataset_name == 'cdbg' || inputs.dataset_name == 'all'
uses: ./.github/workflows/cdbg_build.yml
secrets: inherit
with:
image_tag: ${{ needs.health_check.outputs.tag }}
recipe_file: ${{ inputs.recipe_file }}
build_name: ${{ needs.health_check.outputs.build_name }}
plan_command: ${{ needs.health_check.outputs.plan_command }}
dev_bucket: ${{ inputs.dev_bucket && format('de-dev-{0}', inputs.dev_bucket) || '' }}
checkbook:
needs: health_check
if: inputs.dataset_name == 'checkbook' || inputs.dataset_name == 'all'
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/cdbg_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CDBG - 🏗️ Build
on:
workflow_call:
inputs:
image_tag:
type: string
required: false
build_name:
type: string
required: true
recipe_file:
type: string
required: true
plan_command:
type: string
default: recipe
dev_bucket:
type: string
required: false

jobs:
build:
name: Build CDBG
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
working-directory: products/cdbg
container:
image: nycplanning/build-base:${{ inputs.image_tag || 'latest' }}
env:
BUILD_ENGINE_DB: db-cdbg
BUILD_NAME: ${{ inputs.build_name }}
RECIPES_BUCKET: ${{ inputs.dev_bucket || 'edm-recipes' }}
PUBLISHING_BUCKET: ${{ inputs.dev_bucket || 'edm-publishing' }}
DEV_FLAG: ${{ inputs.dev_bucket && 'true' || 'false' }}
steps:
- uses: actions/checkout@v4

- name: Load Secrets
uses: 1password/load-secrets-action@v1
with:
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
AWS_S3_ENDPOINT: "op://Data Engineering/DO_keys/AWS_S3_ENDPOINT"
AWS_SECRET_ACCESS_KEY: "op://Data Engineering/DO_keys/AWS_SECRET_ACCESS_KEY"
AWS_ACCESS_KEY_ID: "op://Data Engineering/DO_keys/AWS_ACCESS_KEY_ID"
BUILD_ENGINE_SERVER: "op://Data Engineering/EDM_DATA/server_url"
BUILD_ENGINE_HOST: "op://Data Engineering/EDM_DATA/server"
BUILD_ENGINE_USER: "op://Data Engineering/EDM_DATA/username"
BUILD_ENGINE_PASSWORD: "op://Data Engineering/EDM_DATA/password"
BUILD_ENGINE_PORT: "op://Data Engineering/EDM_DATA/port"

- name: Setup build environment
working-directory: ./
run: |
./bash/docker_container_setup.sh
./bash/build_env_setup.sh
- name: Plan build
run: python3 -m dcpy.lifecycle.builds.plan ${{ inputs.plan_command }}

- name: Dataloading
run: python -m dcpy.lifecycle.builds.load load --recipe-path ${{ inputs.recipe_file }}.lock.yml

# - name: Build
# run: ./bash/build.sh
#
# - name: Export
# run: ./bash/export.sh
#
# - name: Upload
# run: python3 -m dcpy.connectors.edm.publishing upload --product db-green-fast-track --acl public-read
1 change: 1 addition & 0 deletions .github/workflows/test_helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
project:
- green_fast_track
- zoningtaxlots
- cdbg
steps:
- uses: actions/checkout@v4
- name: setup
Expand Down

0 comments on commit 98167a6

Please sign in to comment.