gitea_heroku/deploy.sh
2024-10-23 18:31:36 +02:00

25 lines
567 B
Bash

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