@@ -2,11 +2,8 @@ name: CI Docker build
22
33on :
44 workflow_dispatch :
5- # release:
6- # types: [published]
7- push :
8- branches :
9- - guest-mods
5+ pull_request :
6+
107jobs :
118 build-and-push-image :
129 runs-on : ubuntu-latest
2825 username : ${{ github.actor }}
2926 password : ${{ secrets.GITHUB_TOKEN }}
3027
31- - name : Extract metadata (tags, labels) for Docker
32- id : meta
33- uses : docker/metadata-action@v5
34- with :
35- images : ghcr.io/${{ github.repository }}
36- flavor : |
37- latest=auto
38- prefix=
39- suffix=
40- tags : |
41- type=semver,pattern={{version}}
42- type=semver,pattern={{major}}.{{minor}}
43- type=semver,pattern={{major}}
44- type=ref,event=branch,prefix=dev-
45-
4628 - name : Set version to tag name
4729 if : ${{ github.event_name == 'release' }}
4830 run : echo "${GITHUB_REF_NAME}" > version
@@ -51,12 +33,16 @@ jobs:
5133 if : ${{ github.event_name != 'release' }}
5234 run : echo "${GITHUB_SHA}" | cut -c1-7 > version
5335
36+ - name : downcase REPO
37+ run : |
38+ echo "REPO=$(echo "$GITHUB_REPOSITORY" | tr '[:upper:]' '[:lower:]')" >>${GITHUB_ENV}
39+
5440 - name : Build and push Docker image
5541 uses : docker/build-push-action@v6
5642 with :
5743 file : docker/app/Dockerfile
5844 context : .
5945 push : true
60- tags : ${{ steps.meta.outputs.tags }}
46+ tags : " ghcr.io/${REPO}:${{github.head_ref}} "
6147 labels : ${{ steps.meta.outputs.labels }}
6248
0 commit comments