From bce39cf4cc93382dc6713d5b6181c688e2ce78bd Mon Sep 17 00:00:00 2001 From: dzikafoczka Date: Wed, 23 Oct 2024 18:23:51 +0200 Subject: [PATCH] Deploy to Heroku --- Dockerfile | 8 +++++--- deploy.sh | 21 +++++++++++++++++++++ heroku-app.txt | 1 + 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 deploy.sh create mode 100644 heroku-app.txt diff --git a/Dockerfile b/Dockerfile index 6573ec0..a44ba44 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,13 @@ FROM gitea/gitea:1.14.5-rootless -ARG APP_NAME -ENV APP_NAME=${APP_NAME} +WORKDIR /app + +COPY heroku-app.txt /app/heroku-app.txt USER root -WORKDIR /app + COPY script.sh /app/script.sh + RUN chmod +x /app/script.sh ENTRYPOINT ./script.sh \ No newline at end of file diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..abf4add --- /dev/null +++ b/deploy.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Create git repository if it doesn't exist +if [ ! -d ".git" ]; then + git init +fi + +# Create a new Heroku app +appName = $(heroku create --stack heroku-24 --region eu --json | jq -r '.name') +echo $appName > heroku-app.txt + +# Add Heroku Postgres add-on +heroku addons:create heroku-postgresql:essential-0 --app s464863-gitea + +# Push to Heroku +git add . +git commit -m "Deploy to Heroku" +git push heroku main + +# Open the app in the browser +heroku open --app s464863-gitea \ No newline at end of file diff --git a/heroku-app.txt b/heroku-app.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/heroku-app.txt @@ -0,0 +1 @@ +