2024-10-23 18:23:51 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Create git repository if it doesn't exist
|
|
|
|
if [ ! -d ".git" ]; then
|
|
|
|
git init
|
|
|
|
fi
|
|
|
|
|
2024-10-23 18:29:00 +02:00
|
|
|
# App name
|
|
|
|
APP_NAME=s464863-gitea
|
|
|
|
|
2024-10-23 18:23:51 +02:00
|
|
|
# Create a new Heroku app
|
2024-10-23 18:33:07 +02:00
|
|
|
WEB_URL=$(heroku create --stack container --region eu $APP_NAME --json | jq -r '.web_url')
|
2024-10-23 18:29:00 +02:00
|
|
|
echo $WEB_URL > heroku-app.txt
|
2024-10-23 18:23:51 +02:00
|
|
|
|
|
|
|
# Add Heroku Postgres add-on
|
|
|
|
heroku addons:create heroku-postgresql:essential-0 --app s464863-gitea
|
|
|
|
|
|
|
|
# Push to Heroku
|
2024-10-23 18:31:36 +02:00
|
|
|
heroku git:remote --app s464863-gitea
|
2024-10-23 18:23:51 +02:00
|
|
|
git add .
|
|
|
|
git commit -m "Deploy to Heroku"
|
2024-10-23 18:32:10 +02:00
|
|
|
git push heroku main
|
2024-10-23 18:23:51 +02:00
|
|
|
|
|
|
|
# Open the app in the browser
|
|
|
|
heroku open --app s464863-gitea
|