Skip to content

Commit

Permalink
Publish Docker image to GitHub repository.
Browse files Browse the repository at this point in the history
  • Loading branch information
ayosec committed Nov 6, 2024
1 parent c44f415 commit ad6fb38
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test Docker Image
name: Container Image

on:
pull_request:
Expand All @@ -10,6 +10,10 @@ jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4

Expand All @@ -23,3 +27,17 @@ jobs:
out=$(mktemp -d)
docker run --volume "$out:/out" --rm ffdocs -o /out -v 1.0.*
test "$(find "$out" -name '*.html' | wc -l)" -ge 2
- name: Push Image
if: github.ref_name == 'main'
run: |
set -e
echo "${{ secrets.GITHUB_TOKEN }}" \
| docker login ghcr.io -u "${{ github.actor }}" --password-stdin
IMAGE_ID=ghcr.io/${{ github.repository }}:latest
set -x
docker tag ffdocs "$IMAGE_ID"
docker push "$IMAGE_ID"
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,22 @@ $ nix develop --command ./ffmpeg-filters-docs […]

### Docker

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

```console
$ docker build --tag ffdocs --file docker/Dockerfile .
$ docker run --rm -v /tmp/ffdocs:/out ghcr.io/ayosec/ffmpeg-filters-docs --output /out
```

To run a local checkout of the repository (for example, to test changes in the implementation), replace the `/app` directory:

$ docker run --volume /tmp/web:/tmp/web ffdocs --versions 7.1 --output /tmp/web
```console
$ docker run --rm -v /tmp/ffdocs:/out -v "$PWD:/app" ghcr.io/ayosec/ffmpeg-filters-docs --output /out
```

The image can be built locally with the file [`docker/Dockerfile`](./docker/Dockerfile):

```console
$ docker build --tag ffmpeg-filters-docs --file docker/Dockerfile .
```


Expand Down

0 comments on commit ad6fb38

Please sign in to comment.