Merge pull request #15 from OriginalByteMe/feature/optimizations #3
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: CI/CD | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
env: | |
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }} | |
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Install Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Install Modal | |
run: | | |
python -m pip install --upgrade pip | |
pip install modal | |
- name: Set environment | |
id: vars | |
run: | | |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | |
echo "::set-output name=environment::prod" | |
else | |
echo "::set-output name=environment::dev" | |
fi | |
- name: Deploy cutout generator job | |
run: | | |
cd app | |
modal deploy --env ${{ steps.vars.outputs.environment }} grounded_cutouts.py | |
- name: Deploy s3_handler job | |
run: | | |
cd app/s3_handler | |
modal deploy --env ${{ steps.vars.outputs.environment }} app.py | |