Releases: throw-if-null/docker-semver-github-action
Docker CI with SemVer tagging
Info
The Action for Docker uses the SemVer version for image tagging.
That means that if you are pushing an image:
docker push myimage:1.4.2
It will be tagged as latest and pushed, but also images:
- myimage:1.4
- myimage:1
will be tagged as latest and pushed.
This way when you specify in your Docker file:
FROM myimage:latest
you will pull version 1.4.2, but if you specify:
FROM myimage:1.4
or
FROM myimage:1
you will also pull the version 1.4.2
Now lets image that there is an image with version 1.3.6 and also 1.4.0 if you specify:
FROM myimage:1.3
it will pull the 1.3.6 (assuming that next version is 1.4.x) and if you specify:
FROM myimage:1.4.0
it will pul the version 1.4.0 although there is a more recent release (1.4.2).
This might not be useful to everyone but it does suite my needs.
Usage
Example:
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Publish to Registry
uses: mirzamerdovic/docker-semver-github-action@master
with:
name: myDocker/repository
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
semver: 1.2.5
Check the repo README for more info.
Thanks and Credits
I need to say a big thank you to elghor who made Publish-Docker-Github-Action that I forked and built this one from. He also has some other useful actions that you might one to check out.