-
Notifications
You must be signed in to change notification settings - Fork 2
76 lines (68 loc) · 2.74 KB
/
update_dockerhub_readme.yaml
File metadata and controls
76 lines (68 loc) · 2.74 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: 'Update: DockerHub ReadMe'
on:
push:
#branches:
# - 'main'
# - 'master'
paths:
- '.github/workflows/update_dockerhub_readme.yaml'
- 'README.md'
workflow_dispatch:
#schedule:
# - cron: '00 04 01 * *' # At 04:00 on day-of-month 01.
defaults:
run:
shell: bash
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Shell-Script
id: script
run: |
BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}"
COMMIT_HASH=${GITHUB_SHA::7}
GITHUB_REPO=${GITHUB_REPOSITORY,,}
GITHUB_REPO_SHORT=${GITHUB_REPO#*/}
GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"}
DOCKER_REPO=${{ vars.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT}
REDHAT_QUAY_REPO=${{ vars.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT}
# Set output parameters to action.
echo "build_date=${BUILD_DATE}" >> "$GITHUB_OUTPUT"
echo "build_date_numeric=${BUILD_DATE_NUMERIC}" >> "$GITHUB_OUTPUT"
echo "commit_hash=${COMMIT_HASH}" >> "$GITHUB_OUTPUT"
echo "github_repo=${GITHUB_REPO}" >> "$GITHUB_OUTPUT"
echo "docker_repo=${DOCKER_REPO}" >> "$GITHUB_OUTPUT"
echo "redhat_quay_repo=${REDHAT_QUAY_REPO}" >> "$GITHUB_OUTPUT"
# https://github.com/peter-evans/dockerhub-description
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v5
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: ${{steps.script.outputs.docker_repo}}
short-description: ${{ github.event.repository.description }}
readme-filepath: README.md
## https://github.com/christian-korneck/update-container-description-action
#- name: Docker Hub Description
# uses: christian-korneck/update-container-description-action@v1
# env:
# DOCKER_USER: ${{ vars.DOCKER_USERNAME }}
# DOCKER_PASS: ${{ secrets.DOCKER_PASSWORD }}
# with:
# destination_container_repo: ${{steps.script.outputs.docker_repo}}
# provider: dockerhub
# short_description: ${{ github.event.repository.description }}
# readme_file: 'README.md'
## https://github.com/christian-korneck/update-container-description-action
#- name: Quay.io Description
# uses: christian-korneck/update-container-description-action@v1
# env:
# DOCKER_APIKEY: ${{ secrets.APIKEY__QUAY_IO }}
# with:
# destination_container_repo: quay.io/${{steps.script.outputs.redhat_quay_repo}}
# provider: quay
# readme_file: 'README.md'