diff --git a/.github/workflows/deploy-website.yaml b/.github/workflows/deploy-website.yaml index 47ec9ad..739c467 100644 --- a/.github/workflows/deploy-website.yaml +++ b/.github/workflows/deploy-website.yaml @@ -4,9 +4,6 @@ on: branches: master -permissions: - contents: write - jobs: deploy-website: runs-on: ubuntu-latest @@ -14,15 +11,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Install and Build - run: | - go build -C src -o ../compiler - mkdir build - mv assets build - ./compiler -path references.bib > build/index.html + - name: Set up flyctl + uses: superfly/flyctl-actions/setup-flyctl@master - - name: Deploy - uses: JamesIves/github-pages-deploy-action@v4 - with: - # Must be identical to where we wrote the HTML to. - folder: build + - name: Deploy to fly.io + run: flyctl deploy + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..211282f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM golang:1.26-alpine AS builder +WORKDIR /app +COPY src/ ./src/ +COPY references.bib . +COPY assets/ ./assets/ +RUN go build -C src -mod=vendor -o ../compiler +RUN ./compiler -path references.bib > index.html + +FROM nginx:alpine +COPY --from=builder /app/assets /usr/share/nginx/html/assets +COPY --from=builder /app/index.html /usr/share/nginx/html/index.html diff --git a/fly.toml b/fly.toml new file mode 100644 index 0000000..4d657a4 --- /dev/null +++ b/fly.toml @@ -0,0 +1,22 @@ +# fly.toml app configuration file generated for censorbib on 2026-06-16T12:27:53-05:00 +# +# See https://fly.io/docs/reference/configuration/ for information about how to use this file. +# + +app = 'censorbib' +primary_region = 'ord' + +[build] + +[http_service] + internal_port = 80 + force_https = true + auto_stop_machines = 'stop' + auto_start_machines = true + min_machines_running = 0 + processes = ['app'] + +[[vm]] + memory = '256mb' + cpus = 1 + memory_mb = 256 diff --git a/src/html.go b/src/html.go index 68bacba..ff29340 100644 --- a/src/html.go +++ b/src/html.go @@ -30,7 +30,7 @@ var bibEntryTemplate = template.Must(template.New("bib-entry").Parse(`