Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
chore: Dockerfile creds for private deps
Browse files Browse the repository at this point in the history
  • Loading branch information
axb-topos committed Aug 9, 2022
1 parent fb9331a commit 44a1e2a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/rs_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@ jobs:
uses: fusion-engineering/setup-git-credentials@v2
with:
credentials: https://robot-toposware:${{ secrets.ROBOT_TOPOSWARE_PRIV_REPOS_TOKEN }}@github.com

- name: Install Rust ${{ matrix.version }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.version }}
components:
override: true
build-args: |
PRIV_GH_USER=robot-toposware
PRIV_GH_TOKEN=${{ secrets.ROBOT_TOPOSWARE_GH_PACKAGE_TOKEN }}
- uses: Swatinem/rust-cache@v1

Expand All @@ -51,6 +55,9 @@ jobs:
with:
command: test
args: --workspace
build-args: |
PRIV_GH_USER=robot-toposware
PRIV_GH_TOKEN=${{ secrets.ROBOT_TOPOSWARE_GH_PACKAGE_TOKEN }}
fmt:
name: fmt
Expand Down
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#
# Builder
#
FROM --platform=linux/amd64 rust:slim-bullseye AS builder
FROM --platform=linux/amd64 ghcr.io/toposware/topos-ci-docker:master AS builder

ARG PRIV_GH_USER
ARG PRIV_GH_TOKEN

ENV PRIV_GH_USER ${PRIV_GH_USER}
ENV PRIV_GH_TOKEN ${PRIV_GH_TOKEN}

RUN rustup toolchain install nightly && \
rustup default nightly && \
Expand Down Expand Up @@ -40,12 +46,12 @@ COPY ./protocols/transport/Cargo.toml ./protocols/transport/Cargo.toml
COPY ./params-minimizer/Cargo.toml ./params-minimizer/Cargo.toml
COPY ./tests ./tests

RUN cargo fetch
RUN . /init.sh && cargo fetch

# sources and build
#
COPY ./ .
RUN cargo build --release
RUN . /init.sh && cargo build --release

#
# Final image
Expand Down

0 comments on commit 44a1e2a

Please sign in to comment.