diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..7de2e19 --- /dev/null +++ b/.dockerignore @@ -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 diff --git a/.github/workflows/fly-deploy.yml b/.github/workflows/fly-deploy.yml new file mode 100644 index 0000000..b0c246e --- /dev/null +++ b/.github/workflows/fly-deploy.yml @@ -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 }} diff --git a/Dockerfile b/Dockerfile index d080894..d4c553c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ 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 @@ -17,5 +18,6 @@ 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"] diff --git a/README.md b/README.md index eefe402..e66918c 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,16 @@ This approach offers a number of advantages, including: - [x] Cookie/IP deduplication - [ ] Detect survey changes in real time +## Demo Links + +
+ Console UI * + simple * + custom_theme * + short * + many_options +
+ ## 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. diff --git a/fly.toml b/fly.toml new file mode 100644 index 0000000..89c98e8 --- /dev/null +++ b/fly.toml @@ -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'