Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support private repo authentication #43

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ on:

jobs:
lint_test:
uses: babylonlabs-io/.github/.github/workflows/reusable_go_lint_test.yml@v0.1.0
uses: babylonlabs-io/.github/.github/workflows/reusable_go_lint_test.yml@v0.4.0
secrets: inherit
with:
run-unit-tests: true
run-integration-tests: true
run-lint: true
run-build: true
go-private-repos-authentication: true

docker_pipeline:
uses: babylonlabs-io/.github/.github/workflows/reusable_docker_pipeline.yml@v0.1.0
uses: babylonlabs-io/.github/.github/workflows/reusable_docker_pipeline.yml@v0.4.0
secrets: inherit
with:
publish: false
go-private-repos-authentication: true
8 changes: 6 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@ on:

jobs:
lint_test:
uses: babylonlabs-io/.github/.github/workflows/reusable_go_lint_test.yml@v0.1.0
uses: babylonlabs-io/.github/.github/workflows/reusable_go_lint_test.yml@v0.4.0
secrets: inherit
with:
run-unit-tests: true
run-integration-tests: true
run-lint: true
run-build: true
go-private-repos-authentication: true

docker_pipeline:
needs: ["lint_test"]
uses: babylonlabs-io/.github/.github/workflows/reusable_docker_pipeline.yml@v0.1.0
uses: babylonlabs-io/.github/.github/workflows/reusable_docker_pipeline.yml@v0.4.0
secrets: inherit
with:
publish: true
go-private-repos-authentication: true
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21.4-alpine as builder

Check warning on line 1 in Dockerfile

View workflow job for this annotation

GitHub Actions / docker_pipeline / docker_build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

# Version to build. Default is the Git HEAD.
ARG VERSION="HEAD"
Expand All @@ -12,6 +12,12 @@
libzmq-static libsodium-static gcc


# Ensure secrets are accessible
RUN --mount=type=secret,id=GO_PRIVATE_TOKEN \
TOKEN=$(cat /run/secrets/GO_PRIVATE_TOKEN) && \
git config --global url."https://${TOKEN}@github.com/".insteadOf "https://github.com/"


# Build
WORKDIR /go/src/github.com/babylonlabs-io/finality-provider
# Cache dependencies
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ $(BUILDDIR)/:
mkdir -p $(BUILDDIR)/

build-docker:
$(DOCKER) build --tag babylonlabs-io/finality-provider -f Dockerfile \
$(DOCKER) build --secret id=GO_PRIVATE_TOKEN --tag babylonlabs-io/finality-provider -f Dockerfile \
$(shell git rev-parse --show-toplevel)

.PHONY: build build-docker
Expand Down