Publish Docker images #181
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Docker images | |
on: | |
workflow_dispatch: {} | |
schedule: | |
- cron: "46 2 * * 1" | |
jobs: | |
build-and-push: | |
name: Build Docker images | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Build images | |
env: | |
zsh_tags: | | |
master | |
5.9 | |
5.8.1 | |
5.8 | |
5.7.1 | |
5.7 | |
5.6.2 | |
5.6.1 | |
5.6 | |
5.5.1 | |
5.5 | |
5.4.2 | |
5.4.1 | |
5.4 | |
5.3.1 | |
5.3 | |
5.2 | |
5.1.1 | |
5.1 | |
5.0.8 | |
5.0.7 | |
5.0.6 | |
5.0.5 | |
5.0.4 | |
5.0.3 | |
5.0.2 | |
5.0.1 | |
5.0.0 | |
4.3.17 | |
4.3.16 | |
4.3.15 | |
4.3.14 | |
4.3.13 | |
4.3.12 | |
4.3.11 | |
run: | | |
for image in */Dockerfile; do | |
image="$(basename $(dirname $image))" | |
if ! test -f "$image/build.sh"; then | |
echo "::error ::missing build.sh file at /$image" | |
exit 1 | |
fi | |
"$image/build.sh" ${{ secrets.DOCKERHUB_ORG }} | |
done | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USER }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Push to Docker Hub | |
run: | | |
for image in */Dockerfile; do | |
image="$(basename $(dirname $image))" | |
docker push "${{ secrets.DOCKERHUB_ORG }}/$image" --all-tags | |
done | |
- name: Update image READMEs | |
env: | |
DH_USERNAME: ${{ secrets.DOCKERHUB_USER }} | |
DH_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} | |
run: | | |
for image in */Dockerfile; do | |
image="$(basename $(dirname $image))" | |
if ! test -f "$image/README.md"; then | |
echo "::warning ::missing README.md file at /$image" | |
continue | |
fi | |
node .github/scripts/update-image-readme.js "${{ secrets.DOCKERHUB_ORG }}/$image" "$image/README.md" | |
done |