Skip to content

Commit

Permalink
Automatically update Docker description on push (#697)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauust authored Jul 22, 2022
1 parent 7160bb7 commit 3156641
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ env:
jobs:
build:
runs-on: ubuntu-latest
if: github.repository_owner == 'lycheeverse' &&
github.actor != 'dependabot[bot]' &&
( github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.event.pull_request.base.repo.owner.login )
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Docker meta
id: meta
Expand All @@ -45,25 +48,31 @@ jobs:
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
if: github.repository_owner == 'lycheeverse' && github.actor != 'dependabot[bot]' && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.event.pull_request.base.repo.owner.login )
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Push Image
if: github.repository_owner == 'lycheeverse'
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: ${{ env.DOCKERFILE }}
platforms: ${{ env.DOCKER_PLATFORMS }}
push: ${{ github.event_name != 'pull_request' && github.actor != 'dependabot[bot]' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Update DockerHub description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: lycheeverse/lychee
readme-filepath: README.md

0 comments on commit 3156641

Please sign in to comment.