fix customer_data_app #33
Workflow file for this run
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 | |
on: | |
push: | |
branches: | |
- lendemor/deploy_pipeline | |
# swap to this before merging to main | |
# on: | |
# release: | |
# types: [published] | |
jobs: | |
setup-matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
folders: ${{ steps.generate-matrix.outputs.folders }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Generate Matrix | |
id: generate-matrix | |
run: | | |
FOLDERS=$(ls -d */ | sed 's|/||g' | jq -R -s -c 'split("\n")[:-1]') | |
echo "folders=$FOLDERS" >> $GITHUB_OUTPUT | |
- name: Debug output (matrix) | |
run: | | |
echo "Subfolders: ${{ env.folders }}" | |
deploy: | |
needs: setup-matrix | |
runs-on: ubuntu-latest | |
environment: Cloud Deploy | |
strategy: | |
matrix: | |
folder: ${{fromJson(needs.setup-matrix.outputs.folders)}} | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
pip install -r ${{ matrix.folder }}/requirements.txt | |
- name: Set environment dynamically | |
id: set-env | |
run: | | |
case ${{ matrix.folder }} in | |
ai_image_gen) | |
echo "EXTRA_ARGS=--env REPLICATE_API_TOKEN=${{ secrets.REPLICATE_API_TOKEN }}" >> $GITHUB_ENV | |
;; | |
sales) | |
echo "EXTRA_ARGS=--env OPEN_AI_KEY=${{ secrets.OPEN_AI_KEY }}" >> $GITHUB_ENV | |
;; | |
nba) | |
echo "EXTRA_ARGS=--vmtype c1m1" >> $GITHUB_ENV | |
;; | |
*) | |
echo "EXTRA_ARGS=" >> $GITHUB_ENV | |
;; | |
esac | |
- name: Deploy to ReflexCloud | |
env: | |
REFLEX_AUTH_TOKEN: ${{ secrets.REFLEX_AUTH_TOKEN }} | |
run: | | |
chmod +x deploy.sh | |
./deploy.sh ${{ matrix.folder }} "$EXTRA_ARGS" |