Docker build system: upload to DockerHub

This commit is contained in:
Bernhard Ehlers 2023-05-27 17:41:05 +02:00
parent c80dd65dfc
commit 12289975de

View File

@ -1,4 +1,4 @@
name: Build Docker images and upload to ghcr.io name: Build Docker images and upload to DockerHub
on: on:
push: push:
branches: branches:
@ -32,19 +32,23 @@ jobs:
# https://github.com/marketplace/actions/docker-login # https://github.com/marketplace/actions/docker-login
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
registry: ghcr.io username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ github.repository_owner }} password: ${{ secrets.DOCKERHUB_TOKEN }}
password: ${{ secrets.GITHUB_TOKEN }} # GitHub Container Registry:
# DockerHub: # registry: ghcr.io
# with: # username: ${{ github.repository_owner }}
# username: ${{ secrets.DOCKERHUB_USERNAME }} # password: ${{ secrets.GITHUB_TOKEN }}
# password: ${{ secrets.DOCKERHUB_TOKEN }} # DockerHub:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Install python requirements - name: Install python requirements
run: python3 -m pip install --requirement .github/bin/requirements.txt run: python3 -m pip install --requirement .github/bin/requirements.txt
- name: Build and push images - name: Build and push images
env: env:
DOCKER_ACCOUNT: ghcr.io/${{ github.repository_owner }} DOCKER_ACCOUNT: ${{ secrets.DOCKERHUB_USERNAME }}
# DOCKER_PASSWORD is optional, only needed for private repositories # DOCKER_PASSWORD is optional, only needed for private repositories
# GitHub Container Registry:
# DOCKER_ACCOUNT: ghcr.io/${{ github.repository_owner }}
# DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} # DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
# DockerHub: # DockerHub:
# DOCKER_ACCOUNT: ${{ secrets.DOCKERHUB_USERNAME }} # DOCKER_ACCOUNT: ${{ secrets.DOCKERHUB_USERNAME }}