Skip to content

Commit

Permalink
fly.io deployment (rebased with slim root.tsx)
Browse files Browse the repository at this point in the history
  • Loading branch information
thadk committed Dec 6, 2023
1 parent 4e7a068 commit 2670973
Show file tree
Hide file tree
Showing 6 changed files with 381 additions and 81 deletions.
85 changes: 43 additions & 42 deletions .github/workflows/heat-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ on:
push:
branches:
- main
# - dev
- gha-deployment
- dev
pull_request: {}

env:
Expand Down Expand Up @@ -155,46 +156,46 @@ jobs:
# path: playwright-report/
# retention-days: 30

# deploy:
# name: 🚀 Deploy
# runs-on: ubuntu-latest
# needs: [lint, typecheck, vitest, playwright]
# # only build/deploy main branch on pushes
# if:
# ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') &&
# github.event_name == 'push' }}
deploy:
name: 🚀 Deploy
runs-on: ubuntu-latest
needs: [lint, typecheck, vitest] #, playwright]
# only build/deploy main branch on pushes
if:
${{ (github.ref == 'refs/heads/gha-deployment' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') &&
github.event_name == 'push' }}

# steps:
# - name: ⬇️ Checkout repo
# uses: actions/checkout@v3
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3

# - name: 👀 Read app name
# uses: SebRollen/[email protected]
# id: app_name
# with:
# file: 'fly.toml'
# field: 'app'

# # move Dockerfile to root
# - name: 🚚 Move Dockerfile
# run: |
# mv ./other/Dockerfile ./Dockerfile
# mv ./other/.dockerignore ./.dockerignore

# - name: 🎈 Setup Fly
# uses: superfly/flyctl-actions/[email protected]

# - name: 🚀 Deploy Staging
# if: ${{ github.ref == 'refs/heads/dev' }}
# run:
# flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }}
# --app ${{ steps.app_name.outputs.value }}-staging
# env:
# FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

# - name: 🚀 Deploy Production
# if: ${{ github.ref == 'refs/heads/main' }}
# run:
# flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }}
# env:
# FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- name: 👀 Read app name
uses: SebRollen/[email protected]
id: app_name
with:
file: '${{ env.working-directory }}/fly.toml'
field: 'app'

# move Dockerfile to root
- name: 🚚 Move Dockerfile
run: |
mv ./other/Dockerfile ./Dockerfile
mv ./other/.dockerignore ./.dockerignore
- name: 🎈 Setup Fly
uses: superfly/flyctl-actions/[email protected]

- name: 🚀 Deploy Staging
if: ${{ github.ref == 'refs/heads/dev' }}
run:
flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }}
--app ${{ steps.app_name.outputs.value }}-staging
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

- name: 🚀 Deploy Production
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/gha-deployment' }}
run:
flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }}
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
23 changes: 14 additions & 9 deletions heat-stack/app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
import { cssBundleHref } from '@remix-run/css-bundle'
import fontStyleSheetUrl from './styles/font.css'
import tailwindStyleSheetUrl from './styles/tailwind.css'
import {

Check warning on line 2 in heat-stack/app/root.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

Import "HeadersFunction" is only used as types

Check warning on line 2 in heat-stack/app/root.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

Import "HeadersFunction" is only used as types
type DataFunctionArgs,
HeadersFunction,
json,
type LinksFunction,
} from '@remix-run/node'
import { Links, Scripts } from '@remix-run/react'
import { CaseSummary } from './components/CaseSummary.tsx'
import { href as iconsHref } from './components/ui/icon.tsx'
import { DataFunctionArgs, HeadersFunction, json, type LinksFunction } from '@remix-run/node'
import fontStyleSheetUrl from './styles/font.css'
import tailwindStyleSheetUrl from './styles/tailwind.css'

import { CaseSummary } from './components/CaseSummary.tsx'
import './App.css'
import { getUserId } from './utils/auth.server.ts'
import { getHints } from './utils/client-hints.tsx'
import { prisma } from './utils/db.server.ts'
import { getEnv } from './utils/env.server.ts'
import { combineHeaders, getDomainUrl } from './utils/misc.tsx'
import { useNonce } from './utils/nonce-provider.ts'
import { combineServerTimings, makeTimings, time } from './utils/timing.server.ts'
import { combineHeaders, getDomainUrl } from './utils/misc.tsx'
import { getEnv } from './utils/env.server.ts'
// Hints may not be required. Double check.
import { getHints } from './utils/client-hints.tsx'
import { WeatherExample } from './components/WeatherExample.tsx'

Check warning on line 23 in heat-stack/app/root.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

`./components/WeatherExample.tsx` import should occur before import of `./styles/font.css`

Check warning on line 23 in heat-stack/app/root.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

'WeatherExample' is defined but never used

Check warning on line 23 in heat-stack/app/root.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

`./components/WeatherExample.tsx` import should occur before import of `./styles/font.css`

Check warning on line 23 in heat-stack/app/root.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

'WeatherExample' is defined but never used
import { Weather } from './WeatherExample.js'

Check warning on line 24 in heat-stack/app/root.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

All imports in the declaration are only used as types. Use `import type`

Check warning on line 24 in heat-stack/app/root.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

All imports in the declaration are only used as types. Use `import type`
import { getUserId } from './utils/auth.server.ts'
import { prisma } from './utils/db.server.ts'
import { csrf } from './utils/csrf.server.ts'

Check warning on line 25 in heat-stack/app/root.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

`./utils/csrf.server.ts` import should occur before import of `./utils/db.server.ts`

Check warning on line 25 in heat-stack/app/root.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

`./utils/csrf.server.ts` import should occur before import of `./utils/db.server.ts`
import { honeypot } from './utils/honeypot.server.ts'

Expand Down
Loading

0 comments on commit 2670973

Please sign in to comment.