-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from neelasha23/prod
deployment env
- Loading branch information
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Ploomber Cloud | ||
|
||
on: | ||
push: | ||
branches: | ||
# only deploy from the main branch | ||
- main | ||
|
||
jobs: | ||
deploy-to-ploomber-cloud-dev: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install ploomber-cloud | ||
- name: Deploy | ||
env: | ||
PLOOMBER_CLOUD_KEY: ${{ secrets.PLOOMBER_CLOUD_KEY }} | ||
run: | | ||
ploomber-cloud deploy --config ploomber-cloud.dev.json --watch-incremental | tee watch.log | ||
# The --watch-incremental flag will print deployment status and deployment | ||
# log updates to the GitHub logs. | ||
# To learn more, visit: https://docs.cloud.ploomber.io/en/latest/user-guide/github.html | ||
|
||
- name: Check for failure | ||
run: | | ||
if grep -q "Deployment failed" watch.log; then | ||
exit 1 | ||
fi | ||
deploy-to-ploomber-cloud-prod: | ||
runs-on: ubuntu-latest | ||
environment: 'prod' | ||
needs: [deploy-to-ploomber-cloud-dev] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install ploomber-cloud | ||
- name: Deploy | ||
env: | ||
PLOOMBER_CLOUD_KEY: ${{ secrets.PLOOMBER_CLOUD_KEY }} | ||
run: | | ||
ploomber-cloud deploy --config ploomber-cloud.prod.json --watch-incremental |