File tree Expand file tree Collapse file tree 1 file changed +4
-36
lines changed
Expand file tree Collapse file tree 1 file changed +4
-36
lines changed Original file line number Diff line number Diff line change 1- name : Build & Push Docker image
1+ name : Build & Push Docker image (latest)
22
33on :
44 push :
5- branches : ["main"]
5+ branches : [ "main" ]
66 workflow_dispatch :
7- inputs :
8- tag :
9- description : " Optional tag override (leave empty to use branch name)"
10- required : false
11- default : " "
127
138permissions :
149 contents : read
@@ -30,39 +25,12 @@ jobs:
3025 username : ${{ secrets.DOCKERHUB_USERNAME }}
3126 password : ${{ secrets.DOCKERHUB_TOKEN }}
3227
33-
34- - name : Compute image tag
35- id : meta
36- shell : bash
37- run : |
38- set -euo pipefail
39-
40- if [[ "${GITHUB_EVENT_NAME}" == "push" && "${GITHUB_REF_NAME}" == "main" ]]; then
41- TAG="latest"
42- else
43- # If user provided an override tag, use it; otherwise use the branch name
44- TAG_INPUT="${{ github.event.inputs.tag }}"
45- if [[ -n "${TAG_INPUT}" ]]; then
46- TAG="${TAG_INPUT}"
47- else
48- TAG="${GITHUB_REF_NAME}"
49- fi
50- fi
51-
52- TAG="$(echo "${TAG}" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9._-]+/-/g; s/^-+//; s/-+$//')"
53-
54- # Docker tags <= 128 chars
55- TAG="${TAG:0:128}"
56-
57- echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
58- echo "Using tag: ${TAG}"
59-
60- - name : Build and push
28+ - name : Build and push (latest)
6129 uses : docker/build-push-action@v6
6230 with :
6331 context : .
6432 file : ./Dockerfile
6533 push : true
66- tags : oceanenterprise/market:${{ steps.meta.outputs.tag }}
34+ tags : oceanenterprise/market:latest
6735 cache-from : type=gha
6836 cache-to : type=gha,mode=max
You can’t perform that action at this time.
0 commit comments