[github] add workflow to build and push docker images

heavily inspired by and adapted from
https://github.com/danbooru/danbooru/blob/master/.github/workflows/docker-build.yaml
pull/4906/head
Mike Fährmann 10 months ago
parent 4dde36889c
commit 43ca49c1b4
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -0,0 +1,61 @@
name: docker
on:
push:
branches:
- master
tags:
- v[0-9]+.[0-9]+.[0-9]+
permissions:
packages: write
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# https://github.com/docker/login-action
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# https://github.com/docker/metadata-action
- name: Generate Docker tags
uses: docker/metadata-action@v5
id: metadata
with:
images: |
mikf123/gallery-dl
ghcr.io/mikf/gallery-dl
tags: |
type=sha,format=long,prefix=
type=ref,event=tag
# https://github.com/docker/metadata-action/issues/112
flavor: |
latest=${{ github.ref == 'refs/heads/master' }}
# https://github.com/docker/build-push-action
- name: Build image
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
platforms: linux/amd64

@ -24,7 +24,7 @@ jobs:
python-packages: "toml"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} ${{ matrix.architecture }}
uses: actions/setup-python@v4

@ -18,7 +18,7 @@ jobs:
python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.9"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check file permissions
run: |

@ -6,4 +6,4 @@
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
__version__ = "1.26.3"
__version__ = "1.26.4-dev"

@ -161,6 +161,6 @@ build-python
build-linux
build-windows
sign
upload-git
upload-pypi
upload-git
update-dev

Loading…
Cancel
Save