added docker hub

This commit is contained in:
ArabCoders 2023-12-02 15:13:31 +03:00
parent 9fa5709b91
commit b3febb5616

View file

@ -26,6 +26,8 @@ on:
- ".github/ISSUE_TEMPLATE/**"
env:
DOCKERHUB_SLUG: arabcoders/ytptube
GHCR_SLUG: ghcr.io/arabcoders/ytptube
PLATFORMS: linux/amd64
jobs:
@ -53,7 +55,9 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
images: |
${{ env.DOCKERHUB_SLUG }}
${{ env.GHCR_SLUG }}
tags: |
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
type=ref,event=branch
@ -69,6 +73,12 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
@ -79,3 +89,19 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, scope=${{ github.workflow }}
dockerhub-sync-readme:
needs: push-build
runs-on: ubuntu-latest
steps:
- name: Sync README
uses: docker://lsiodev/readme-sync:latest
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
GIT_REPOSITORY: ${{ github.repository }}
DOCKER_REPOSITORY: ${{ env.DOCKERHUB_SLUG }}
GIT_BRANCH: master
with:
entrypoint: node
args: /opt/docker-readme-sync/sync