Skip to content

Commit

Permalink
Docker repo description template
Browse files Browse the repository at this point in the history
  • Loading branch information
wopox1337 committed Apr 2, 2024
1 parent b41eae1 commit e737ef5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/.teamplate-README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[![Docker Pulls](https://img.shields.io/docker/pulls/$dockerUser/$dockerRepo?logo=docker&logoColor=blue)](https://hub.docker.com/r/$dockerUser/$dockerRepo)
[![Docker Image Size](https://img.shields.io/docker/image-size/$dockerUser/$dockerRepo?logo=docker&logoColor=blue)](https://hub.docker.com/r/$dockerUser/$dockerRepo)
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/$githubRepository/CI.yml?logo=github&logoColor=white)](https://github.com/$githubRepository/actions/workflows/CI.yml)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/110aad918e184a51956adf55f6e770b3)](https://app.codacy.com/gh/$githubRepository/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)

<img src="https://raw.githubusercontent.com/docker-library/docs/c350af05d3fac7b5c3f6327ac82fe4d990d8729c/docker/logo.png" alt="Docker logo" width="200"><img src="$logoUrl" alt="Mod logo" height="200">

This Docker image contains the HLDS of the `$mod` game.
26 changes: 25 additions & 1 deletion .github/workflows/dockerhub-description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,47 @@ on:
- 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 }}
short-description: ${{ github.event.repository.description }} (${{ matrix.mod }})
readme-filepath: ${{ env.TEAMPLATE_PATH }}

0 comments on commit e737ef5

Please sign in to comment.