-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (46 loc) · 1.7 KB
/
dockerhub-description.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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/checkout@v4.1.1
- 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 }}