Skip to content

Commit

Permalink
Merge pull request #13 from emoltz/dev
Browse files Browse the repository at this point in the history
temporarily removed script
  • Loading branch information
emoltz authored Jun 9, 2024
2 parents c08d4b8 + e3ea121 commit 88ae926
Showing 1 changed file with 52 additions and 52 deletions.
104 changes: 52 additions & 52 deletions .github/workflows/migrate.yml
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 }}

0 comments on commit 88ae926

Please sign in to comment.