Skip to content

Commit

Permalink
Add demo links
Browse files Browse the repository at this point in the history
  • Loading branch information
plutov committed Aug 7, 2024
1 parent 046d662 commit fcf6cbe
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# flyctl launch added from .gitignore
**/pkg/github/tmp
**/pkg/parser/tmp
**/postgres-data
**/.DS_Store

# flyctl launch added from ui/.gitignore
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
ui/node_modules
ui/.pnp
ui/**/.pnp.js

# testing
ui/coverage

# next.js
ui/.next
ui/out

# production
ui/build

# misc
ui/**/.DS_Store

# debug
ui/**/npm-debug.log*
ui/**/yarn-debug.log*
ui/**/yarn-error.log*
fly.toml
18 changes: 18 additions & 0 deletions .github/workflows/fly-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/

name: Fly Deploy
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
concurrency: deploy-group # optional: ensure only one action runs at a time
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ RUN go mod download
COPY ./cmd ./cmd
COPY ./pkg ./pkg
COPY ./migrations ./migrations
COPY ./surveys ./surveys-examples
RUN CGO_ENABLED=0 GOOS=linux go build -o api cmd/console-api/api.go

FROM alpine:latest
RUN apk --no-cache add ca-certificates tzdata bash
WORKDIR /root
COPY --from=builder /go/src/github.com/plutov/formulosity/api .
COPY --from=builder /go/src/github.com/plutov/formulosity/migrations ./migrations
COPY --from=builder /go/src/github.com/plutov/formulosity/surveys-examples ./surveys-examples

CMD ["./api"]
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ This approach offers a number of advantages, including:
- [x] Cookie/IP deduplication
- [ ] Detect survey changes in real time

## Demo Links

<p align="center" width="100%">
<a href="https://formulosity.vercel.app/app">Console UI</a> *
<a href="https://formulosity.vercel.app/survey/rhaxwhxm76iu">simple</a> *
<a href="https://formulosity.vercel.app/survey/29zphubxwujn">custom_theme</a> *
<a href="https://formulosity.vercel.app/survey/6n28ezs64v2f">short</a> *
<a href="https://formulosity.vercel.app/survey/rqvzuy0hkau4">many_options</a>
</p>

## Survey Structure

Each directory in `SURVEYS_DIR` is a survey. You can configure the source of your surveys by setting different `SURVEYS_DIR` env var.
Expand Down
15 changes: 15 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
app = 'formulosity'
primary_region = 'ams'

[build]

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

[[vm]]
size = 'shared-cpu-1x'

0 comments on commit fcf6cbe

Please sign in to comment.