diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..f0123c0 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,41 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + paths: + - "Dockerfile" + - "requirements.txt" + - ".github/workflows/**" + +permissions: + contents: read + packages: write + +#jobs: + +# build: + +# runs-on: ubuntu-latest + +# steps: +# - uses: actions/checkout@v4 +# - name: Build the Docker image +# run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build Docker image + run: docker build . --file Dockerfile --tag ghcr.io/supersharkboiii/epstudio:latest + + - name: Push Docker image + run: docker push ghcr.io/supersharkboiii/epstudio:latest diff --git a/app.py b/app.py index 22b9f1d..1f0aa6b 100644 --- a/app.py +++ b/app.py @@ -147,7 +147,8 @@ def auth_response(): if "error" in result: print("error") flash("Authentication error: " + result["error"], "error") - return render_template("auth_error.html", result=result) + #return render_template("auth_error.html", result=result) + return result, 400 user_info = auth.get_user() print(user_info) @@ -375,4 +376,4 @@ def delete_creation(creation_id): db.session.commit() flash("Creation deleted", "success") - return redirect(url_for("user_profile", user_id=current_user.id)) \ No newline at end of file + return redirect(url_for("user_profile", user_id=current_user.id)) diff --git a/app_config.py b/app_config.py index 27ed2e8..69f12d8 100644 --- a/app_config.py +++ b/app_config.py @@ -7,6 +7,7 @@ # AUTHORITY = "https://login.microsoftonline.com/common" # For multi-tenant app AUTHORITY = f"https://login.microsoftonline.com/{os.getenv('TENANT_ID', 'common')}" +# AUTHORITY = f"https://login.microsoftonline.com/{os.getenv('TENANT_ID')}" REDIRECT_PATH = "/callback" # Used for forming an absolute URL to your redirect URI. # The absolute URL must match the redirect URI you set diff --git a/templates/base.html b/templates/base.html index 961759a..ef6c99b 100644 --- a/templates/base.html +++ b/templates/base.html @@ -23,6 +23,9 @@ + + +