Skip to content

Commit 3c26ab1

Browse files
cleanup
1 parent 85dbe7a commit 3c26ab1

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

.github/workflows/release.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ permissions:
99

1010
on:
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

1618
jobs:
1719
linux:
@@ -78,6 +80,17 @@ jobs:
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'
@@ -87,4 +100,4 @@ jobs:
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 }}

docker/Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
FROM alpine:3.19
1+
FROM alpine:3.19 AS builder
22

33
ARG CLI_VERSION
44

55
RUN 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"]

0 commit comments

Comments
 (0)