Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup CI/CD process around the se-demos-dev workspace #85

Merged
merged 14 commits into from
Apr 19, 2024
9 changes: 8 additions & 1 deletion .github/workflows/aws_datalake.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
push:
branches:
- main
- dev
paths:
- "flows/aws/datalake/**"
workflow_dispatch:
Expand All @@ -16,6 +17,9 @@ jobs:
name: Deploy AWS datalake flows
runs-on: ubuntu-latest

env:
WORKSPACE: ${{ github.ref == 'refs/heads/main' && 'se-demos' || 'se-demos-dev' }}

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -39,12 +43,15 @@ jobs:

- name: Prefect Deploy
env:
BRANCH: ${{ github.ref_name }}
GITHUB_SHA: ${{ steps.get-commit-hash.outputs.COMMIT_HASH }}
PREFECT_API_KEY: ${{ secrets.PREFECT_API_KEY }}
ECR_REPO: ${{ secrets.ECR_REPO }}
WORKSPACE: ${{ github.ref == 'refs/heads/main' && 'se-demos' || 'se-demos-dev' }}
WORK_POOL_NAME: ${{ github.ref == 'refs/heads/main' && 'Demo-ECS' || 'Dev-ECS' }}
run: |
cd flows/aws/datalake
pip install -r requirements-ci.txt
prefect cloud workspace set -w sales-engineering/se-datalake
prefect cloud workspace set -w sales-engineering/$WORKSPACE
python deploy.py

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion flows/aws/datalake/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

ecr_repo = os.getenv("ECR_REPO")
image_tag = os.getenv("GITHUB_SHA")
work_pool_name = os.getenv("WORK_POOL_NAME")


deploy(
Expand All @@ -40,5 +41,5 @@
tag=image_tag,
dockerfile="Dockerfile",
),
work_pool_name="Demo-ECS",
work_pool_name=work_pool_name,
)