Repository navigation
Build and publish the Docker image with GitHub Actions - #2
Merged
Merged
Conversation
Docker Hub autobuilds stopped working long ago (both webhooks on this repo fail with 403/502), so images have been built and pushed by hand. The workflow builds and smoke-tests the image on every push to master and every PR. Pushing a git tag also publishes ubcctlt/response-map:<tag>. The smoke test checks the PHP version, the mysqli/gd/imagick/OPcache extensions, php -l on every file, and that Apache serves PHP. The old `latest` tag is left alone. Also exclude .github/ from the image so the workflow file isn't served from the web root, and document the release steps in the README.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Docker Hub autobuilds for
ubcctlt/response-maphave been broken for years. Both Docker Hub webhooks on this repo fail on every push (403 and 502), and the last automated image islatestfrom 2018.1.0.0–1.0.3were all built and pushed by hand.What
New workflow
.github/workflows/docker-image.yml:master/ pull requests: build thelinux/amd64image and smoke-test it. Nothing is published.1.0.4): same build and test, then pushubcctlt/response-map:<tag>, the tag the deployment config pins. It uses the org secretsDOCKER_HUB_USERNAME/DOCKER_HUB_ACCESS_TOKEN, the same ones compair, moodle-docker, etc. use.php -v; check that mysqli, gd, imagick and Zend OPcache load;php -lon every PHP file; start the container and check that Apache answers withX-Powered-By: PHP/….latestis not moved (flavor: latest=false). Deployments pin release tags.contents: readtoken; checkout doesn't persist credentials; every action pinned to a commit SHA with its version in a comment.Also:
.dockerignore: exclude.github/. OtherwiseCOPY .would put the workflow file in the public web root.README.md: a short "Releasing a Docker image" section.Test plan
actionlint(with shellcheck): no issues.github/is not in the built imageubcctlt/response-map:<tag>(the push path can't run from a PR)After merge
69152217,90674326).ubcctltorg access on Docker Hub should turn off autobuild forubcctlt/response-map.