Debian Codegraph @

.github/workflows/container_description.yml

raw
1 ---
2 name: Push README to Docker Hub
3 on:
4 push:
5 paths:
6 - "README.md"
7 - "README-containers.md"
8 - ".github/workflows/container_description.yml"
9 branches: [ main, master ]
10
11 permissions:
12 contents: read
13
14 jobs:
15 PushDockerHubReadme:
16 runs-on: ubuntu-latest
17 name: Push README to Docker Hub
18 if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
19 steps:
20 - name: git checkout
21 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22 with:
23 persist-credentials: false
24 - name: Set docker hub repo name
25 run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
26 - name: Push README to Dockerhub
27 uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1
28 env:
29 DOCKER_USER: ${{ secrets.DOCKER_HUB_LOGIN }}
30 DOCKER_PASS: ${{ secrets.DOCKER_HUB_PASSWORD }}
31 with:
32 destination_container_repo: ${{ env.DOCKER_REPO_NAME }}
33 provider: dockerhub
34 short_description: ${{ env.DOCKER_REPO_NAME }}
35 # Empty string results in README-containers.md being pushed if it
36 # exists. Otherwise, README.md is pushed.
37 readme_file: ''
38
39 PushQuayIoReadme:
40 runs-on: ubuntu-latest
41 name: Push README to quay.io
42 if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
43 steps:
44 - name: git checkout
45 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
46 with:
47 persist-credentials: false
48 - name: Set quay.io org name
49 run: echo "DOCKER_REPO=$(echo quay.io/${GITHUB_REPOSITORY_OWNER} | tr -d '-')" >> $GITHUB_ENV
50 - name: Set quay.io repo name
51 run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
52 - name: Push README to quay.io
53 uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1
54 env:
55 DOCKER_APIKEY: ${{ secrets.QUAY_IO_API_TOKEN }}
56 with:
57 destination_container_repo: ${{ env.DOCKER_REPO_NAME }}
58 provider: quay
59 # Empty string results in README-containers.md being pushed if it
60 # exists. Otherwise, README.md is pushed.
61 readme_file: ''