-
Notifications
You must be signed in to change notification settings - Fork 0
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 #13 from emoltz/dev
temporarily removed script
- Loading branch information
Showing
1 changed file
with
52 additions
and
52 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 |
---|---|---|
@@ -1,52 +1,52 @@ | ||
name: Deploy and Migrate | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy to Heroku and Run Migrations | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Heroku CLI | ||
run: | | ||
curl https://cli-assets.heroku.com/install.sh | sh | ||
- name: Authenticate with Heroku | ||
env: | ||
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | ||
run: | | ||
echo "machine api.heroku.com" > ~/.netrc | ||
echo " login ${{ secrets.HEROKU_EMAIL }}" >> ~/.netrc | ||
echo " password ${{ secrets.HEROKU_API_KEY }}" >> ~/.netrc | ||
echo "machine git.heroku.com" >> ~/.netrc | ||
echo " login ${{ secrets.HEROKU_EMAIL }}" >> ~/.netrc | ||
echo " password ${{ secrets.HEROKU_API_KEY }}" >> ~/.netrc | ||
chmod 600 ~/.netrc | ||
heroku git:remote -a ${{ secrets.HEROKU_APP_NAME }} | ||
- name: Deploy to Heroku | ||
run: git push heroku main | ||
|
||
- name: Wait for deployment | ||
run: | | ||
until [[ $(curl -s https://api.heroku.com/apps/${{ secrets.HEROKU_APP_NAME }}/releases \ | ||
-H "Accept: application/vnd.heroku+json; version=3" \ | ||
-H "Authorization: Bearer ${{ secrets.HEROKU_API_KEY }}" \ | ||
| jq -r '.[-1].status') == "succeeded" ]]; do | ||
echo "Waiting for deployment to complete..." | ||
sleep 10 | ||
done | ||
env: | ||
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | ||
|
||
- name: Run Migrations on Heroku | ||
run: heroku run python manage.py migrate --app ${{ secrets.HEROKU_APP_NAME }} | ||
env: | ||
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | ||
#name: Deploy and Migrate | ||
# | ||
#on: | ||
# push: | ||
# branches: | ||
# - main | ||
# | ||
#jobs: | ||
# deploy: | ||
# name: Deploy to Heroku and Run Migrations | ||
# runs-on: ubuntu-latest | ||
# | ||
# steps: | ||
# - name: Checkout code | ||
# uses: actions/checkout@v2 | ||
# | ||
# - name: Install Heroku CLI | ||
# run: | | ||
# curl https://cli-assets.heroku.com/install.sh | sh | ||
# | ||
# - name: Authenticate with Heroku | ||
# env: | ||
# HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | ||
# run: | | ||
# echo "machine api.heroku.com" > ~/.netrc | ||
# echo " login ${{ secrets.HEROKU_EMAIL }}" >> ~/.netrc | ||
# echo " password ${{ secrets.HEROKU_API_KEY }}" >> ~/.netrc | ||
# echo "machine git.heroku.com" >> ~/.netrc | ||
# echo " login ${{ secrets.HEROKU_EMAIL }}" >> ~/.netrc | ||
# echo " password ${{ secrets.HEROKU_API_KEY }}" >> ~/.netrc | ||
# chmod 600 ~/.netrc | ||
# heroku git:remote -a ${{ secrets.HEROKU_APP_NAME }} | ||
# | ||
# - name: Deploy to Heroku | ||
# run: git push heroku main | ||
# | ||
# - name: Wait for deployment | ||
# run: | | ||
# until [[ $(curl -s https://api.heroku.com/apps/${{ secrets.HEROKU_APP_NAME }}/releases \ | ||
# -H "Accept: application/vnd.heroku+json; version=3" \ | ||
# -H "Authorization: Bearer ${{ secrets.HEROKU_API_KEY }}" \ | ||
# | jq -r '.[-1].status') == "succeeded" ]]; do | ||
# echo "Waiting for deployment to complete..." | ||
# sleep 10 | ||
# done | ||
# env: | ||
# HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | ||
# | ||
# - name: Run Migrations on Heroku | ||
# run: heroku run python manage.py migrate --app ${{ secrets.HEROKU_APP_NAME }} | ||
# env: | ||
# HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} |