Skip to content

Commit 5ec0f63

Browse files
committed
docker/ci: fix building for branches
1 parent 80972ec commit 5ec0f63

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/docker-image.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ jobs:
1717
- name: Build and push
1818
uses: docker/build-push-action@v6
1919
with:
20-
tags: manio/aa-proxy-rs:latest
20+
build-args: |
21+
GH_BRANCH=${{ github.ref_name }}
22+
tags: manio/aa-proxy-rs:${{ github.ref_name }}
2123
allow: security.insecure
2224
outputs: build
2325
- name: Upload a Build Artifact

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# syntax=docker/dockerfile:1-labs
2+
ARG GH_BRANCH=main
23
FROM rust:latest AS stage-rust
4+
ARG GH_BRANCH
5+
ENV GH_BRANCH=${GH_BRANCH}
36
# crosscompile stuff
47
RUN apt update && apt upgrade -y
58
RUN apt install -y gcc-arm-linux-gnueabihf
69
RUN rustup target add arm-unknown-linux-gnueabihf
710
# cloning and building
811
WORKDIR /usr/src/app
9-
RUN git clone https://github.com/manio/aa-proxy-rs .
12+
RUN echo "Cloning branch: ${GH_BRANCH}"
13+
RUN git clone --branch ${GH_BRANCH} --single-branch https://github.com/manio/aa-proxy-rs .
1014
RUN cargo build --release
1115
RUN arm-linux-gnueabihf-strip target/arm-unknown-linux-gnueabihf/release/aa-proxy-rs
1216
# Pi Zero W needs special linking/building (https://github.com/manio/aa-proxy-rs/issues/3)

0 commit comments

Comments
 (0)