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

Chore/i want to kill myself #268

Merged
merged 3 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/deploy.production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Fly Deploy Production

on: [workflow_dispatch]

jobs:
deploy-web:
name: Deploy Web
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only --config fly.production.toml --build-arg VITE_FIREBASE_PROJECT_ID=${{ secrets.VITE_FIREBASE_PROJECT_ID }} --build-arg VITE_REACT_APP_API_KEY=${{ secrets.VITE_REACT_APP_API_KEY }} --build-arg VITE_REACT_APP_AUTH_DOMAIN=${{ secrets.VITE_REACT_APP_AUTH_DOMAIN }} --build-arg VITE_REACT_APP_STORAGE_BUCKET=${{ secrets.VITE_REACT_APP_STORAGE_BUCKET }} --build-arg VITE_REACT_APP_MESSAGING_SENDER_ID=${{ secrets.VITE_REACT_APP_MESSAGING_SENDER_ID }} --build-arg VITE_REACT_APP_APP_ID=${{ secrets.VITE_REACT_APP_APP_ID }} --build-arg VITE_REACT_APP_MEASUREMENT_ID=${{ secrets.VITE_REACT_APP_MEASUREMENT_ID }} --build-arg VITE_REACT_APP_SERVER_URL=${{ secrets.VITE_REACT_APP_SERVER_URL_PRODUCTION }}
working-directory: ./frontend
env:
FLY_API_TOKEN: ${{ secrets.FLY_PRODUCTION_API_TOKEN }}

deploy-api:
name: Deploy Api
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only --config fly.production.toml
working-directory: ./backend
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_PRODUCTION_API_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/deploy.staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only --config fly.staging.toml --build-arg VITE_FIREBASE_PROJECT_ID=${{ secrets.VITE_FIREBASE_PROJECT_ID }} --build-arg VITE_REACT_APP_API_KEY=${{ secrets.VITE_REACT_APP_API_KEY }} --build-arg VITE_REACT_APP_AUTH_DOMAIN=${{ secrets.VITE_REACT_APP_AUTH_DOMAIN }} --build-arg VITE_REACT_APP_STORAGE_BUCKET=${{ secrets.VITE_REACT_APP_STORAGE_BUCKET }} --build-arg VITE_REACT_APP_MESSAGING_SENDER_ID=${{ secrets.VITE_REACT_APP_MESSAGING_SENDER_ID }} --build-arg VITE_REACT_APP_APP_ID=${{ secrets.VITE_REACT_APP_APP_ID }} --build-arg VITE_REACT_APP_MEASUREMENT_ID=${{ secrets.VITE_REACT_APP_MEASUREMENT_ID }}
- run: flyctl deploy --remote-only --config fly.staging.toml --build-arg VITE_FIREBASE_PROJECT_ID=${{ secrets.VITE_FIREBASE_PROJECT_ID }} --build-arg VITE_REACT_APP_API_KEY=${{ secrets.VITE_REACT_APP_API_KEY }} --build-arg VITE_REACT_APP_AUTH_DOMAIN=${{ secrets.VITE_REACT_APP_AUTH_DOMAIN }} --build-arg VITE_REACT_APP_STORAGE_BUCKET=${{ secrets.VITE_REACT_APP_STORAGE_BUCKET }} --build-arg VITE_REACT_APP_MESSAGING_SENDER_ID=${{ secrets.VITE_REACT_APP_MESSAGING_SENDER_ID }} --build-arg VITE_REACT_APP_APP_ID=${{ secrets.VITE_REACT_APP_APP_ID }} --build-arg VITE_REACT_APP_MEASUREMENT_ID=${{ secrets.VITE_REACT_APP_MEASUREMENT_ID }} --build-arg VITE_REACT_APP_SERVER_URL=${{ secrets.VITE_REACT_APP_SERVER_URL_STAGING }}
working-directory: ./frontend
env:
FLY_API_TOKEN: ${{ secrets.FLY_STAGING_API_TOKEN }}
Expand Down
18 changes: 18 additions & 0 deletions backend/fly.production.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
app = 'wdcc-vps-api'
primary_region = 'syd'

[build]
dockerfile = "Dockerfile"

[http_service]
internal_port = 5000
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ['app']

[[vm]]
cpu_kind = 'shared'
cpus = 1
memory_mb = 1024
5 changes: 2 additions & 3 deletions frontend/Dockerfile.staging → frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ ARG VITE_REACT_APP_STORAGE_BUCKET
ARG VITE_REACT_APP_MESSAGING_SENDER_ID
ARG VITE_REACT_APP_APP_ID
ARG VITE_REACT_APP_MEASUREMENT_ID
ARG VITE_REACT_APP_SERVER_URL

ENV VITE_FIREBASE_PROJECT_ID=${VITE_FIREBASE_PROJECT_ID}
ENV VITE_REACT_APP_API_KEY=${VITE_REACT_APP_API_KEY}
Expand All @@ -42,9 +43,7 @@ ENV VITE_REACT_APP_STORAGE_BUCKET=${VITE_REACT_APP_STORAGE_BUCKET}
ENV VITE_REACT_APP_MESSAGING_SENDER_ID=${VITE_REACT_APP_MESSAGING_SENDER_ID}
ENV VITE_REACT_APP_APP_ID=${VITE_REACT_APP_APP_ID}
ENV VITE_REACT_APP_MEASUREMENT_ID=${VITE_REACT_APP_MEASUREMENT_ID}

# Set server URL
ENV VITE_REACT_APP_SERVER_URL="https://wdcc-vps-api-staging.fly.dev"
ENV VITE_REACT_APP_SERVER_URL=${VITE_REACT_APP_SERVER_URL}

# Build the app with environment variables
RUN yarn run build
Expand Down
19 changes: 19 additions & 0 deletions frontend/fly.production.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
app = 'wdcc-vps'
primary_region = 'syd'

[build]
# dockerfile contains build time non-sensitive env vars
dockerfile = "Dockerfile"

[http_service]
internal_port = 80
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ['app']

[[vm]]
cpu_kind = 'shared'
cpus = 1
memory_mb = 1024
2 changes: 1 addition & 1 deletion frontend/fly.staging.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ primary_region = 'syd'

[build]
# dockerfile contains build time non-sensitive env vars
dockerfile = "Dockerfile.staging"
dockerfile = "Dockerfile"

[http_service]
internal_port = 80
Expand Down
Loading