Skip to content

Commit

Permalink
configure login package deployment (#4)
Browse files Browse the repository at this point in the history
* set dockerfile in toml

* fix dockerfile start command

* separate dev and prod deployments

* fix conditions

* fix dotenv secret names
  • Loading branch information
alecananian authored Jan 19, 2024
1 parent 0b830ea commit 61ab6a6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/deploy-login.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Deploy Login
on:
workflow_dispatch:
inputs:
environment:
type: choice
description: Select environment
options:
- development
- production
jobs:
deploy:
name: Deploy Login
Expand All @@ -10,9 +17,21 @@ jobs:
uses: styfle/cancel-workflow-action@0.11.0
- name: Checkout repo
uses: actions/checkout@v3
- name: Read app name
uses: SebRollen/toml-action@v1.0.0
id: app_name
with:
file: "fly.login.toml"
field: "app"
- name: Setup deploy
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Deploy development
run: flyctl deploy --config ./fly.login.toml --dockerfile ./Dockerfile.login --remote-only --build-secret dotenv="${{ secrets.ENV_DEV }}"
if: ${{ inputs.environment == 'development' }}
run: flyctl deploy --config ./fly.login.toml --app ${{ steps.app_name.outputs.value }}-dev --remote-only --build-secret dotenv="${{ secrets.ENV_DEV }}"
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- name: Deploy production
if: ${{ inputs.environment == 'production' }}
run: flyctl deploy --config ./fly.login.toml --remote-only --build-secret dotenv="${{ secrets.ENV_PROD }}"
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
2 changes: 1 addition & 1 deletion Dockerfile.login
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ RUN npm prune --omit=dev

# Start the server
EXPOSE 3000
CMD [ "npm", "start:login" ]
CMD [ "npm", "run", "start:login" ]
1 change: 1 addition & 0 deletions fly.login.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ app = "tdk-login"
primary_region = "lax"

[build]
dockerfile = "Dockerfile.login"

[http_service]
internal_port = 3000
Expand Down

0 comments on commit 61ab6a6

Please sign in to comment.