pg.ddx.io  GitHub: postgresql-interfaces/psqlodbc (issues + PRs as email threads)  
help / color / mirror / Atom feed
From: davecramer (@davecramer) <noreply+davecramer@github.com>
To: postgresql-interfaces/psqlodbc <noreply+postgresql-interfaces-psqlodbc@github.com>
Subject: [postgresql-interfaces/psqlodbc] PR #227: ci: deploy the website to S3 and CloudFront
Date: Tue, 27 Oct 2026 18:13:07 +0000
Message-ID: <gh-postgresql-interfaces-psqlodbc-227@github.com> (raw)

Builds the Hugo site in `website/` (#233) in GitHub Actions and deploys it to S3 and CloudFront, following the current pgjdbc site deploy.

**Merge #233 first.** This branch is on top of it, because `docs.yml` builds `website/`.

## Workflows

- **`docs.yml`** sets up Go and Hugo extended 0.163.3, builds `website/` with `hugo --minify`, and uploads the result as the `site` artifact. Go is there because Hugo downloads the Hextra theme as a module. It also outputs the driver version from `configure.ac`. It runs on pull requests that change `website/`, `Changelog.md`, `docs/` or either workflow, and lints both workflows there with actionlint. The site mounts `Changelog.md` and some `docs/` files, which is why those paths trigger it.
- **`docs-deploy.yml`** calls `docs.yml` and deploys the site. It runs only from the `www-release` branch, and a run on any other branch fails before it builds. It does four things in order:
  1. Syncs the site to the root of the bucket.
  2. Deletes the files that are no longer in the site, in a second pass. This pass never deletes `/backups/`.
  3. Uploads `/deploy-info.json`, with the deploy time, version, commit and run ID.
  4. Invalidates the CloudFront cache.

  Each deploy replaces the previous one. To roll back, set `www-release` back to an earlier commit and deploy again.

To deploy after a release, move `www-release` to the commit to publish, then run:

```sh
gh workflow run docs-deploy.yml -R postgresql-interfaces/psqlodbc --ref www-release
```

## Needed before the first deploy

PostgreSQL infrastructure owns the AWS account and the `postgresql.org` DNS. This is the same setup as jdbc.postgresql.org:

1. An ACM certificate for `odbc.postgresql.org` in `us-east-1`, validated by a CNAME that infrastructure adds to `postgresql.org`. The CAA records already allow Amazon.
2. A private S3 bucket, readable by the distribution through origin access control. `/backups/psqlodbc-cvs.tar.bz2`, which the current site serves but this repository doesn't contain, can go in this bucket, because the deploy never deletes `/backups/`.
3. A CloudFront distribution for `odbc.postgresql.org` that serves the bucket with that certificate.
4. An IAM role:
   - Trust: GitHub OIDC (`token.actions.githubusercontent.com`) with `sub` = `repo:postgresql-interfaces/psqlodbc:ref:refs/heads/www-release`.
   - Permissions: `s3:ListBucket`, `s3:PutObject` and `s3:DeleteObject` on the bucket, and `cloudfront:CreateInvalidation` on the distribution.
5. The values for the repository variables `SITE_AWS_ROLE_ARN`, `SITE_AWS_REGION`, `SITE_S3_BUCKET` and `SITE_CLOUDFRONT_DISTRIBUTION_ID`, described at the top of `docs-deploy.yml`.
6. Last, once a deploy has been checked at the `*.cloudfront.net` address: repoint `odbc.postgresql.org` from `jerido.postgresql.org` to the distribution.

The `www-release` branch also has to be created from `main` after this merges.

## Testing

- actionlint passes on both workflows.
- Running `hugo --minify` in `website/` builds the site, with no warnings.
- The deploy job has not run, because the AWS resources don't exist yet.

Assisted-By: Claude


view thread (3+ messages)  latest in thread

Message-ID: <gh-postgresql-interfaces-psqlodbc-227@github.com>
Permalink:  ../gh-postgresql-interfaces-psqlodbc-227@github.com/

 · 


This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox