Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/actions/terraform-deploy-sm2a/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,33 @@ runs:

steps:
- name: Set up Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
uses: astral-sh/setup-uv@v5
with:
python-version: "3.11"
cache: "pip"


- name: Setup Terraform
uses: hashicorp/setup-terraform@ed3a0531877aca392eb870f440d9ae7aba83a6bd #v1.4.0
with:
terraform_version: 1.3.10

- name: Test 🧪
working-directory: "veda-data-airflow"
shell: bash
run: |
uv sync --all-groups
export AIRFLOW_HOME=/tmp
uv run airflow db migrate
uv run pytest

- name: Deploy
working-directory: ${{ inputs.dir }}
shell: bash
env:
AWS_DEFAULT_REGION: ${{ inputs.aws-region }}
AWS_REGION: ${{ inputs.aws-region }}
run: |
# Activate uv venv
source ../.venv/bin/activate
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this venv already exist on the runner?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it will be created during uv setup

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. This uv stuff is new to me. Is there reason to deactivate at the end of the job in case another job follows on the same runner? Informational question only, not change request!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It automatically deactivates when the step is complete. You'll need to manually activate it for the next step. It's an annoying thing of GitHub workflows but in this use case it actually turns out to be a useful feature, lol the irony.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uv run make ... should also work here, but this is more explicit anyway

make sm2a-deploy ENV_FILE=${{ inputs.env-file }} SECRET_NAME=${{ inputs.env_aws_secret_name }}

- name: Output workflows API endpoint
Expand Down