Staging #23
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: Deploy to Modal Production | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [closed] | |
branches: | |
- main | |
jobs: | |
deploy: | |
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true)) | |
runs-on: ubuntu-latest | |
env: | |
DB: PROD | |
steps: | |
- name: Checkout workflows repo | |
uses: actions/checkout@v4 | |
with: | |
repository: edenartlab/workflows | |
path: workflows | |
- name: Checkout main repo | |
uses: actions/checkout@v4 | |
with: | |
path: eve | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install the latest version of rye | |
uses: eifinger/setup-rye@v4 | |
- name: Install dependencies | |
working-directory: eve | |
run: rye sync | |
- name: Configure Modal token | |
working-directory: eve | |
run: rye run modal token set --token-id ${{ secrets.MODAL_TOKEN_ID }} --token-secret ${{ secrets.MODAL_TOKEN_SECRET }} | |
- name: Deploy to Modal | |
working-directory: eve | |
run: rye run modal deploy ./eve/api/api.py |