Skip to content

Docker repo description template #18

Docker repo description template

Docker repo description template #18

name: Update Docker Hub Description
on:
workflow_dispatch:
push:
branches: [ master ]
paths:
- README.md
- .github/workflows/dockerhub-description.yml
env:
TEAMPLATE_PATH: .github/.teamplate-README.md
jobs:
update_description:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
mod:
- valve
- cstrike
- czero
include:
- mod: valve
logoUrl: "https://cdn.cloudflare.steamstatic.com/steam/apps/70/header.jpg"
- mod: cstrike
logoUrl: "https://cdn.cloudflare.steamstatic.com/steam/apps/10/header.jpg"
- mod: czero
logoUrl: "https://cdn.cloudflare.steamstatic.com/steam/apps/80/header.jpg"
steps:
- uses: actions/[email protected]
- name: Modify readme for DockerHub
run: |
template=$(cat ${{ env.TEAMPLATE_PATH }})
template="${template//\$dockerUser/${{ secrets.DOCKER_USERNAME }}}"
template="${template//\$dockerRepo/${{ matrix.mod }}}"
template="${template//\$githubRepository/${{ github.repository }}}"
template="${template//\$logoUrl/${{ matrix.logoUrl }}}"
template="${template//\$mod/${{ matrix.mod }}}"
echo "$template" > ${{ env.TEAMPLATE_PATH }}
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: ${{ secrets.DOCKER_USERNAME }}/${{ matrix.mod }}
short-description: ${{ github.event.repository.description }} (${{ matrix.mod }})
readme-filepath: ${{ env.TEAMPLATE_PATH }}