added docker hub
This commit is contained in:
parent
9fa5709b91
commit
b3febb5616
1 changed files with 27 additions and 1 deletions
28
.github/workflows/main.yml
vendored
28
.github/workflows/main.yml
vendored
|
|
@ -26,6 +26,8 @@ on:
|
||||||
- ".github/ISSUE_TEMPLATE/**"
|
- ".github/ISSUE_TEMPLATE/**"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
DOCKERHUB_SLUG: arabcoders/ytptube
|
||||||
|
GHCR_SLUG: ghcr.io/arabcoders/ytptube
|
||||||
PLATFORMS: linux/amd64
|
PLATFORMS: linux/amd64
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
@ -53,7 +55,9 @@ jobs:
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ghcr.io/${{ github.repository }}
|
images: |
|
||||||
|
${{ env.DOCKERHUB_SLUG }}
|
||||||
|
${{ env.GHCR_SLUG }}
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
|
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
|
|
@ -69,6 +73,12 @@ jobs:
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
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
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
|
|
@ -79,3 +89,19 @@ jobs:
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
cache-from: type=gha, scope=${{ github.workflow }}
|
cache-from: type=gha, scope=${{ github.workflow }}
|
||||||
cache-to: 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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue