Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR] Adding env variables to deploy workflow so compile_env works. #102

Merged
merged 11 commits into from
Jul 19, 2023
7 changes: 6 additions & 1 deletion .github/workflows/fly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
push:
branches:
- main
pull_request:
branches: [ main ]
jobs:
deploy:
name: Deploy app
Expand All @@ -14,4 +16,7 @@ jobs:
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
AWS_REGION: eu-west-3
LuchoTurtle marked this conversation as resolved.
Show resolved Hide resolved
AWS_S3_BUCKET_ORIGINAL: imgup-original
AWS_S3_BUCKET_COMPRESSED: imgup-compressed
5 changes: 5 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,11 @@ making it simpler!


```elixir

@original_bucket Application.get_env(:ex_aws, :original_bucket)
@compressed_bucket Application.get_env(:ex_aws, :compressed_bucket)
@compressed_baseurl "https://s3.eu-west-3.amazonaws.com/#{@compressed_bucket}/"

def upload(image) do
with {:ok, {file_cid, file_extension}} <- check_file_binary_and_extension(image),
{:ok, {file_name, upload_response_body}} <-
Expand Down
4 changes: 2 additions & 2 deletions lib/app/upload.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ defmodule App.Upload do
import SweetXml
require Logger

@original_bucket Application.compile_env(:ex_aws, :original_bucket)
@compressed_bucket Application.compile_env(:ex_aws, :compressed_bucket)
@original_bucket Application.get_env(:ex_aws, :original_bucket)
@compressed_bucket Application.get_env(:ex_aws, :compressed_bucket)
nelsonic marked this conversation as resolved.
Show resolved Hide resolved
@compressed_baseurl "https://s3.eu-west-3.amazonaws.com/#{@compressed_bucket}/"

@doc """
Expand Down