File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed
Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,11 @@ permissions:
99
1010on :
1111 push :
12- # run only against tags
12+ # run only against tags on the main branch
1313 tags :
1414 - " v*"
15+ branches :
16+ - main
1517
1618jobs :
1719 linux :
7880 type=raw,value=latest
7981 type=ref,event=tag
8082
83+ - name : Build Only
84+ uses : docker/build-push-action@v6
85+ if : env.DOCKERHUB_LOGIN != 'true'
86+ with :
87+ push : false
88+ file : docker/Dockerfile
89+ platforms : ${{ matrix.platform }}
90+ tags : ${{ steps.meta.outputs.tags }}
91+ build-args : |
92+ CLI_VERSION=${{ steps.meta.outputs.version }}
93+
8194 - name : Build and Push
8295 uses : docker/build-push-action@v6
8396 if : env.DOCKERHUB_LOGIN == 'true'
87100 platforms : ${{ matrix.platform }}
88101 tags : ${{ steps.meta.outputs.tags }}
89102 build-args : |
90- CLI_VERSION=${{ github.ref_name }}
103+ CLI_VERSION=${{ steps.meta.outputs.version }}
Original file line number Diff line number Diff line change 1- FROM alpine:3.19
1+ FROM alpine:3.19 AS builder
22
33ARG CLI_VERSION
44
55RUN apk add --no-cache curl tar && \
66 curl -L --fail "https://github.com/ctrlplanedev/cli/releases/download/${CLI_VERSION}/ctrlc_Linux_x86_64.tar.gz" -o ctrlc.tar.gz && \
77 tar xzf ctrlc.tar.gz && \
88 mv ctrlc /usr/local/bin/ && \
9- chmod +x /usr/local/bin/ctrlc && \
10- rm -rf ctrlc.tar.gz
9+ chmod +x /usr/local/bin/ctrlc
1110
12- CMD ["ctrlc" , "--help" ]
11+ FROM alpine:3.19 AS final
12+
13+ COPY --from=builder /usr/local/bin/ctrlc /usr/local/bin/ctrlc
14+
15+ CMD ["ctrlc" , "--help" ]
You can’t perform that action at this time.
0 commit comments