I want to build a docker image using a GitHub action, migrating from TeamCity.
In the build script, I want to tag the image with a combination of branch and commit, e.g.
Another approach is to use github context.
- name: Create docker image run: ./docker-build.sh ${{ github.head_ref }}.${{ github.sha }}
The benefit of this approach is that you don't have to add a step to set the values. Note that it uses the full version of the sha (not the short version).