Skip to content

Commit ad6fb38

Browse files
committed
Publish Docker image to GitHub repository.
1 parent c44f415 commit ad6fb38

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

.github/workflows/test-docker.yaml renamed to .github/workflows/container-image.yaml

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test Docker Image
1+
name: Container Image
22

33
on:
44
pull_request:
@@ -10,6 +10,10 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212

13+
permissions:
14+
contents: read
15+
packages: write
16+
1317
steps:
1418
- uses: actions/checkout@v4
1519

@@ -23,3 +27,17 @@ jobs:
2327
out=$(mktemp -d)
2428
docker run --volume "$out:/out" --rm ffdocs -o /out -v 1.0.*
2529
test "$(find "$out" -name '*.html' | wc -l)" -ge 2
30+
31+
- name: Push Image
32+
if: github.ref_name == 'main'
33+
run: |
34+
set -e
35+
36+
echo "${{ secrets.GITHUB_TOKEN }}" \
37+
| docker login ghcr.io -u "${{ github.actor }}" --password-stdin
38+
39+
IMAGE_ID=ghcr.io/${{ github.repository }}:latest
40+
41+
set -x
42+
docker tag ffdocs "$IMAGE_ID"
43+
docker push "$IMAGE_ID"

README.md

+13-3
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,22 @@ $ nix develop --command ./ffmpeg-filters-docs […]
8383

8484
### Docker
8585

86-
A Docker image can be built with the file [`docker/Dockerfile`](./docker/Dockerfile).
86+
A Docker image is published to GitHub Packages:
8787

8888
```console
89-
$ docker build --tag ffdocs --file docker/Dockerfile .
89+
$ docker run --rm -v /tmp/ffdocs:/out ghcr.io/ayosec/ffmpeg-filters-docs --output /out
90+
```
91+
92+
To run a local checkout of the repository (for example, to test changes in the implementation), replace the `/app` directory:
9093

91-
$ docker run --volume /tmp/web:/tmp/web ffdocs --versions 7.1 --output /tmp/web
94+
```console
95+
$ docker run --rm -v /tmp/ffdocs:/out -v "$PWD:/app" ghcr.io/ayosec/ffmpeg-filters-docs --output /out
96+
```
97+
98+
The image can be built locally with the file [`docker/Dockerfile`](./docker/Dockerfile):
99+
100+
```console
101+
$ docker build --tag ffmpeg-filters-docs --file docker/Dockerfile .
92102
```
93103

94104

0 commit comments

Comments
 (0)