Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 60 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,55 @@ permissions:
contents: read

jobs:
test:
name: "Test"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4

- name: Build image for testing
uses: docker/build-push-action@v7
with:
context: "${{ matrix.context }}"
push: false
tags: "dockette/web:${{ matrix.tag }}"
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
load: true

- name: Test image
run: make _docker-test-${{ matrix.tag }}

strategy:
matrix:
include:
- { context: debian-php-70, tag: php-70 }
- { context: debian-php-71, tag: php-71 }
- { context: debian-php-72, tag: php-72 }
- { context: debian-php-73, tag: php-73 }
- { context: debian-php-74, tag: php-74 }
- { context: debian-php-80, tag: php-80 }
- { context: debian-php-81, tag: php-81 }
- { context: debian-php-82, tag: php-82 }
- { context: debian-php-83, tag: php-83 }
- { context: debian-php-84, tag: php-84 }
- { context: debian-php-85, tag: php-85 }

build:
name: "Build"
needs: test
uses: dockette/.github/.github/workflows/docker.yml@master
secrets: inherit
with:
image: "dockette/web"
tag: "${{ matrix.tag }}"
context: "${{ matrix.context }}"
image: "dockette/web"
tag: "${{ matrix.tag }}"
context: "${{ matrix.context }}"
push: ${{ github.ref == 'refs/heads/master' }}
strategy:
matrix:
include:
Expand All @@ -35,3 +76,19 @@ jobs:
- { context: debian-php-83, tag: php-83 }
- { context: debian-php-84, tag: php-84 }
- { context: debian-php-85, tag: php-85 }

docs:
name: "Docs"
needs: build
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Update Docker Hub description
uses: peter-evans/dockerhub-description@v5
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: dockette/web
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
DOCKER_IMAGE=dockette/web

.PHONY: templates build test run docker-build-all docker-test-all

templates:
cp -R .templates/ debian-php-70
cp -R .templates/ debian-php-71
Expand Down Expand Up @@ -32,6 +34,13 @@ docker-build-php-83: _docker-build-php-83
docker-build-php-84: _docker-build-php-84
docker-build-php-85: _docker-build-php-85

build: docker-build-all

test: docker-test-all

run:
docker run --rm -it --name dockette-web -p 8000:80 ${DOCKER_IMAGE}:php-85

docker-build-all:
$(MAKE) docker-build-php-70
$(MAKE) docker-build-php-71
Expand Down Expand Up @@ -61,7 +70,10 @@ docker-test-all:

_docker-test-%: VERSION=$*
_docker-test-%:
docker run --rm -d --name dockette-web-${VERSION} -p 8000:80 ${DOCKER_IMAGE}:${VERSION}
sleep 5
set -e; \
container="dockette-web-${VERSION}"; \
docker rm -f "$${container}" >/dev/null 2>&1 || true; \
trap 'docker rm -f "$${container}" >/dev/null 2>&1 || true' EXIT; \
docker run --rm -d --name "$${container}" -p 8000:80 ${DOCKER_IMAGE}:${VERSION}; \
sleep 5; \
curl -f -Li localhost:8000
docker stop dockette-web-${VERSION}
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
</p>

<p align=center>
<a href="https://hub.docker.com/r/dockette/web/"><img src="https://badgen.net/docker/pulls/dockette/web"></a>
<a href="https://bit.ly/ctteg"><img src="https://badgen.net/badge/support/gitter/cyan"></a>
<a href="https://github.com/sponsors/f3l1x"><img src="https://badgen.net/badge/sponsor/donations/F96854"></a>
<a href="https://github.com/dockette/web/actions"><img src="https://github.com/dockette/web/actions/workflows/docker.yml/badge.svg" alt="GitHub Actions"></a>
<a href="https://hub.docker.com/r/dockette/web"><img src="https://img.shields.io/docker/pulls/dockette/web.svg" alt="Docker Hub pulls"></a>
<a href="https://github.com/sponsors/f3l1x"><img src="https://img.shields.io/badge/sponsor-GitHub%20Sponsors-ea4aaa" alt="GitHub Sponsors"></a>
<a href="https://github.com/orgs/dockette/discussions"><img src="https://img.shields.io/badge/support-discussions-6f42c1" alt="Support/Discussions"></a>
</p>

![](https://github.com/dockette/web/blob/master/screenshot.png "It works")
Expand Down Expand Up @@ -96,4 +97,5 @@ There is also username, for example:
```

## 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.