add image (#71) #12
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: Build image and deploy Prefect flow - Project 1 | |
env: | |
PROJECT_NAME: flows/aws/datalake | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "flows/aws/datalake/**" | |
workflow_dispatch: | |
jobs: | |
deploy: | |
name: Deploy AWS datalake flows | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Log in to ECR | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ secrets.ECR_REPO }} | |
username: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
- name: Get commit hash | |
id: get-commit-hash | |
run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
cache: "pip" | |
- name: Prefect Deploy | |
env: | |
GITHUB_SHA: ${{ steps.get-commit-hash.outputs.COMMIT_HASH }} | |
PREFECT_API_KEY: ${{ secrets.PREFECT_API_KEY }} | |
ECR_REPO: ${{ secrets.ECR_REPO }} | |
run: | | |
cd flows/aws/datalake | |
pip install -r requirements-ci.txt | |
prefect cloud workspace set -w sales-engineering/se-datalake | |
python deploy.py | |