-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f0b5aa
commit b2c2204
Showing
5 changed files
with
136 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
# working-directory: ./web | ||
# env: | ||
# FLY_API_TOKEN: ${{ secrets.FLY_WEB_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: ./api | ||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_PRODUCTION_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Fly Deploy Staging | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
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.staging.toml | ||
# working-directory: ./web | ||
# env: | ||
# FLY_API_TOKEN: ${{ secrets.FLY_WEB_STAGING_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.staging.toml | ||
working-directory: ./api | ||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_STAGING_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# syntax = docker/dockerfile:1 | ||
# Adjust NODE_VERSION as desired | ||
ARG NODE_VERSION=18.19.0 | ||
FROM node:${NODE_VERSION}-slim as base | ||
|
||
LABEL fly_launch_runtime="Node.js" | ||
|
||
# Node.js app lives here | ||
WORKDIR /app | ||
|
||
# Set production environment | ||
ARG YARN_VERSION=1.22.19 | ||
RUN npm install -g yarn@$YARN_VERSION --force | ||
|
||
|
||
# Throw-away build stage to reduce size of final image | ||
FROM base as install | ||
|
||
# Install packages needed to build node modules | ||
RUN apt-get update -qq && \ | ||
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3 | ||
|
||
# Install node modules | ||
COPY --link package.json yarn.lock tsconfig.json ./ | ||
COPY --link ./common ./common | ||
COPY --link ./server ./server | ||
RUN yarn install --frozen-lockfile | ||
|
||
# Copy application code | ||
|
||
FROM base as build | ||
|
||
COPY --from=install /app /app | ||
|
||
RUN yarn workspace server build | ||
|
||
# Final stage for app image | ||
FROM base | ||
|
||
# Copy built application | ||
COPY --from=build /app /app | ||
|
||
# Start the server by default, this can be overwritten at runtime | ||
EXPOSE 8000 | ||
CMD [ "yarn", "workspace", "server", "serve" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
app = 'wdcc-uasc-api' | ||
primary_region = 'syd' | ||
|
||
[build] | ||
dockerfile = "Dockerfile" | ||
|
||
[http_service] | ||
internal_port = 8000 | ||
force_https = true | ||
auto_stop_machines = true | ||
auto_start_machines = true | ||
min_machines_running = 0 | ||
processes = ['app'] | ||
|
||
[[vm]] | ||
cpu_kind = 'shared' | ||
cpus = 4 | ||
memory_mb = 2048 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
app = 'wdcc-uasc-api-staging' | ||
primary_region = 'syd' | ||
|
||
[build] | ||
dockerfile = "Dockerfile" | ||
|
||
[http_service] | ||
internal_port = 8000 | ||
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 |