ci: Add docker image automated deploy and PR building #3
+172
−0
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.
To use the github actions workflow to deploy automatically to dockerhub and github packages
All below builds are cross-platform for x86/ARM.
On Push
Triggers on these actions and publishes accordingly:
main
branch => published to dockerhub/ghcrlatest
tagyourBranchName
tagtag
Ie1.0.1
To enable
DOCKER_USERNAME
- your dockerhub usernameDOCKER_PASSWORD
- your dockerhub passwordDOCKERHUB_IMAGE_NAME
- the full name of the dockerhub image IEneede4swede/portall
GHCR_IMAGE_NAME
- the full name of the GHCR image IEghcr.io/neede4swede/portall
On PR
The same settings apply as above except only for dockerhub for security considerations when using
pull_request_trigger
so that the action does not need repo write permissions.When a PR targeting
main
opened it will be built and published to dockerhubpr[issueNumber]
EXpr152
and a comment with a link to the built image will be made in the PR. However this only happens if the PR has the labelsafe to test
so you have a chance to review PR for malicious changes to github actions workflow or other things.The docker build action is also provided a build arg
APP_BUILD_VERSION
that could be used by your application to display the built version based on tag or branch or pr...modify you Dockerfile withAnd then reference
APP_VERSION
env within your app to get the version like:1.0.1
featureBranch-088d063
pr152-088d063