diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0eb4e4e..1e91a3b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -38,18 +38,62 @@ jobs: build: name: "Build" - needs: ["test"] - if: github.ref == 'refs/heads/master' - uses: dockette/.github/.github/workflows/docker.yml@master - secrets: inherit - with: - image: "dockette/pound" - tag: "latest" - context: "." + needs: test + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Read VERSION + id: version + run: cat VERSION >> "$GITHUB_OUTPUT" + + - name: Set up QEMU + uses: docker/setup-qemu-action@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + + - name: Login to DockerHub + if: github.ref == 'refs/heads/master' + uses: docker/login-action@v4 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v7 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: ${{ github.ref == 'refs/heads/master' }} + tags: | + dockette/pound:latest + dockette/pound:${{ steps.version.outputs.VERSION }} + cache-from: type=gha + cache-to: type=gha,mode=max + + release: + name: "Release" + needs: build + if: github.ref == 'refs/heads/master' && github.event_name == 'push' + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Create release + env: + GH_TOKEN: ${{ github.token }} + run: | + . ./VERSION + gh release view "$VERSION" || gh release create "$VERSION" --generate-notes docs: name: "Docs" - needs: ["build"] + needs: build if: github.ref == 'refs/heads/master' uses: dockette/.github/.github/workflows/dockerhub-description.yml@master secrets: inherit diff --git a/AGENTS.md b/AGENTS.md index 8786368..35948b0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -10,13 +10,14 @@ Dockette Pound builds `dockette/pound`, a legacy Pound HTTP/HTTPS reverse proxy - Build context: repository root `.` with `Dockerfile` and `pound/pound.cfg`. - Base image: `debian:trixie-slim`. - The image installs the Debian Trixie `pound` package and starts `pound -f /etc/pound/config.cfg`. -- GitHub Actions builds `linux/amd64` for tests, then publishes `linux/amd64,linux/arm64` through the shared Dockette Docker workflow on `master` and the weekly schedule. +- GitHub Actions builds `linux/amd64` for tests, then publishes `linux/amd64,linux/arm64` in one build job on `master` and the weekly schedule; other branches only build. ## Commands - `make build` builds `${DOCKER_IMAGE}:${DOCKER_TAG}` from `.`. - `make test` runs `pound -V` and validates `/etc/pound/config.cfg` with `pound -c -f` inside the built image. - `make run` starts the image locally with `80:80` published. +- `VERSION` is a key=value file with the release date (`VERSION=...`); `make release` sets today's date. CI pushes `latest` also as `` and creates the GitHub release. ## Testing Notes diff --git a/Makefile b/Makefile index 6dbb47d..df24ffc 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ DOCKER_IMAGE=dockette/pound DOCKER_TAG?=latest +include VERSION + .PHONY: build build: docker build -t ${DOCKER_IMAGE}:${DOCKER_TAG} . @@ -13,3 +15,12 @@ test: .PHONY: run run: docker run --rm -it -p 80:80 ${DOCKER_IMAGE}:${DOCKER_TAG} + +.PHONY: version +version: + @echo ${VERSION} + +.PHONY: release +release: + @sed -i.bak "s/^VERSION=.*/VERSION=$$(date -u +%Y.%m.%d)/" VERSION && rm VERSION.bak + @cat VERSION diff --git a/README.md b/README.md index b50d069..425b6e4 100644 --- a/README.md +++ b/README.md @@ -13,43 +13,45 @@ ----- -## Usage - -```bash -docker run --rm -it \ - -p 80:80 \ - dockette/pound:latest -``` +Legacy image, kept close to the original setup. It uses the official `debian:trixie-slim` base image and the Debian +Trixie `pound` package, so changes stay focused on keeping the image buildable and testable. -The image starts Pound in the foreground with `/etc/pound/config.cfg`. +## Features -## Configuration +- Pound from the Debian Trixie package on `debian:trixie-slim` +- Starts Pound in the foreground with `/etc/pound/config.cfg` +- Bundled configuration listens on port `80` and forwards requests with host headers matching `*.local.dev` to backend + host `app` on port `80` -The bundled configuration listens on port `80` and forwards requests with host headers matching `*.local.dev` to backend host `app` on port `80`. +## Usage -To use your own configuration: +```sh +docker run --rm -it -p 80:80 dockette/pound:latest -```bash -docker run --rm -it \ - -p 80:80 \ - -v "$(pwd)/pound.cfg:/etc/pound/config.cfg:ro" \ - dockette/pound:latest +# use your own configuration +docker run --rm -it -p 80:80 -v "$(pwd)/pound.cfg:/etc/pound/config.cfg:ro" dockette/pound:latest ``` -## Legacy Constraints +## Versions -This image is intentionally kept close to the original legacy setup. It uses the official `debian:trixie-slim` base image and Debian Trixie `pound` package, so changes should stay focused on keeping the existing image buildable and testable. +| Version | Release | +|---------|---------| +| `dockette/pound:YYYY.MM.DD` | release `YYYY.MM.DD` | +| `dockette/pound:latest` | latest build of `master` | -## Development +Releases are listed on [GitHub](https://github.com/dockette/pound/releases). -Build a local image before running tests or starting the container: +## Development -```bash -make build -make test -make run +```sh +make build # build the image +make test # check pound -V and the bundled config +make run # run Pound on port 80 +make version # print VERSION +make release # set today's date in VERSION ``` ## Maintenance -See [how to contribute](https://github.com/dockette/.github/blob/master/CONTRIBUTING.md) to this package. Consider to [support](https://github.com/sponsors/f3l1x) **f3l1x**. Thank you for using this package. +See [how to contribute](https://github.com/dockette/.github/blob/master/CONTRIBUTING.md) to this package. Consider to +[support](https://github.com/sponsors/f3l1x) **f3l1x**. Thank you for using this package. diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..c353908 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +VERSION=2026.10.23