-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NO-TICKET] feat: deploy using fly.io on push to master (#4)
- Loading branch information
Showing
6 changed files
with
308 additions
and
130 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,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
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,15 @@ | ||
name: Deploy App | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
jobs: | ||
deploy: | ||
name: deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: superfly/flyctl-actions/setup-flyctl@master | ||
- run: flyctl deploy --remote-only | ||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_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,47 @@ | ||
# syntax = docker/dockerfile:1 | ||
|
||
# Adjust NODE_VERSION as desired | ||
ARG NODE_VERSION=20.9.0 | ||
FROM node:${NODE_VERSION}-slim as base | ||
|
||
LABEL fly_launch_runtime="Vite" | ||
|
||
# Vite app lives here | ||
WORKDIR /app | ||
|
||
# Set production environment | ||
ENV NODE_ENV="production" | ||
ARG YARN_VERSION=1.22.21 | ||
RUN npm install -g yarn@$YARN_VERSION --force | ||
|
||
|
||
# Throw-away build stage to reduce size of final image | ||
FROM base as build | ||
|
||
# Install packages needed to build node modules | ||
RUN apt-get update -qq && \ | ||
apt-get install -y build-essential pkg-config python-is-python3 | ||
|
||
# Install node modules | ||
COPY --link package.json yarn.lock ./ | ||
RUN yarn install --frozen-lockfile --production=false | ||
|
||
# Copy application code | ||
COPY --link . . | ||
|
||
# Build application | ||
RUN yarn run build | ||
|
||
# Remove development dependencies | ||
RUN yarn install --production=true | ||
|
||
|
||
# Final stage for app image | ||
FROM nginx | ||
|
||
# Copy built application | ||
COPY --from=build /app/dist /usr/share/nginx/html | ||
|
||
# Start the server by default, this can be overwritten at runtime | ||
EXPOSE 80 | ||
CMD [ "/usr/sbin/nginx", "-g", "daemon off;" ] |
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,22 @@ | ||
# fly.toml app configuration file generated for trainee-7-23t3 on 2023-12-09T15:28:53+11:00 | ||
# | ||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file. | ||
# | ||
|
||
app = "trainee-7-23t3" | ||
primary_region = "syd" | ||
|
||
[build] | ||
|
||
[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 |
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
Oops, something went wrong.