Skip to content

Commit

Permalink
add basic fly workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
xHomu committed Feb 4, 2024
1 parent e69baee commit a103d41
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 12 deletions.
16 changes: 16 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# flyctl launch added from .gitignore
**\node_modules

.cache
build
dist
public\build
**\.env
**\yarn.lock

# generated by payload
**\cms\payload-types.ts

# flyctl launch added from node_modules\tailwindcss\stubs\.gitignore
!node_modules\tailwindcss\stubs\**\*
fly.toml
21 changes: 21 additions & 0 deletions .github/workflows/fly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Fly Deploy
on:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
name: Deploy core app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --app "$APP_NAME" --config ./fly.toml --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
APP_NAME: ${{ secrets.APP_NAME }}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ RUN apk update && \
apk add build-base gyp pkgconfig python3

# Install node modules
COPY --link package.json yarn.lock /patches ./
RUN yarn install --frozen-lockfile --production=false
COPY --link package.json ./
RUN yarn install --production=false

# Copy application code
COPY --link . .
Expand Down
1 change: 0 additions & 1 deletion app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export default function App() {
<body>
<Outlet />
<ScrollRestoration />
<LiveReload />
<Scripts />
</body>
</html>
Expand Down
44 changes: 44 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# fly.toml app configuration file generated for repay-divine-bird-61 on 2024-02-04T12:50:51-08:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'repay-divine-bird-61'
primary_region = 'sea'
kill_signal = 'SIGINT'
kill_timeout = '5s'

[build]
dockerfile = 'Dockerfile'

[env]
PORT = '8080'

[http_service]
internal_port = 8080
force_https = true
processes = ['app']

[[services]]
protocol = 'tcp'
internal_port = 8080
processes = ['app']

[[services.ports]]
port = 80
handlers = ['http']
force_https = true

[[services.ports]]
port = 443
handlers = ['tls', 'http']

[services.concurrency]
type = 'requests'
hard_limit = 250
soft_limit = 200

[[vm]]
cpu_kind = 'shared'
cpus = 1
memory_mb = 512
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@
},
"dependencies": {
"@payloadcms/bundler-vite": "^0.1.6",
"@payloadcms/db-mongodb": "^1.3.2",
"@payloadcms/db-mongodb": "^1.4.0",
"@payloadcms/richtext-lexical": "^0.5.2",
"@remix-run/express": "^2.5.1",
"@remix-run/node": "^2.5.1",
"@remix-run/react": "^2.5.1",
"@remix-run/express": "^2.6.0",
"@remix-run/node": "^2.6.0",
"@remix-run/react": "^2.6.0",
"compression": "^1.7.4",
"cross-env": "^7.0.3",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"isbot": "^3.7.0",
"morgan": "^1.10.0",
"payload": "^2.8.2",
"payload": "^2.9.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"source-map-support": "^0.5.21",
"tiny-invariant": "^1.3.1"
},
"devDependencies": {
"@remix-run/dev": "^2.5.1",
"@remix-run/eslint-config": "^2.5.1",
"@remix-run/dev": "^2.6.0",
"@remix-run/eslint-config": "^2.6.0",
"@swc/core": "1.3.100",
"@types/compression": "^1.7.4",
"@types/express": "^4.17.20",
Expand All @@ -51,8 +51,8 @@
"tailwindcss": "^3.3.5",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"vite": "^5.0.10",
"vite-tsconfig-paths": "^4.2.2"
"vite": "^5.0.12",
"vite-tsconfig-paths": "^4.3.1"
},
"engines": {
"node": ">=18"
Expand Down

0 comments on commit a103d41

Please sign in to comment.