Skip to content

Commit

Permalink
Merge pull request #19 from camino-school/fly_deploy
Browse files Browse the repository at this point in the history
Fly deploy
  • Loading branch information
endoooo authored Oct 17, 2023
2 parents f2359dd + 96448a9 commit 1283717
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/fly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.workflow_run.head_branch }}
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
Expand Down
10 changes: 10 additions & 0 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ if config_env() == :prod do
],
secret_key_base: secret_key_base

# Authentication config
google_client_id =
System.get_env("GOOGLE_CLIENT_ID") ||
raise """
environment variable GOOGLE_CLIENT_ID is missing.
For example: 00000-asdf000.apps.googleusercontent.com
"""

config :lanttern, LantternWeb.UserAuth, google_client_id: google_client_id

# ## SSL Support
#
# To get SSL working, you will need to add the `https` key
Expand Down
2 changes: 1 addition & 1 deletion lib/lanttern/google_token.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule Lanttern.GoogleToken do

def token_config do
client_id =
Application.get_env(:lanttern, LantternWeb.UserAuth)
Application.fetch_env!(:lanttern, LantternWeb.UserAuth)
|> Keyword.get(:google_client_id)

%{}
Expand Down
2 changes: 1 addition & 1 deletion lib/lanttern_web/live/user_login_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ defmodule LantternWeb.UserLoginLive do
form = to_form(%{"email" => email}, as: "user")

google_client_id =
Application.get_env(:lanttern, LantternWeb.UserAuth)
Application.fetch_env!(:lanttern, LantternWeb.UserAuth)
|> Keyword.get(:google_client_id)

socket =
Expand Down

0 comments on commit 1283717

Please sign in to comment.