Inject the GITHUB_TOKEN secret into the container builder

This commit is contained in:
Mike Dalessio
2025-03-10 12:30:44 -04:00
parent 40256a4420
commit 9c26633673
4 changed files with 6 additions and 1 deletions
+1
View File
@@ -1,4 +1,5 @@
SECRETS=$(kamal secrets fetch --adapter 1password --account basecamp --from Deploy/Fizzy Deployments/REGISTRY_PASSWORD Beta/SECRET_KEY_BASE)
GITHUB_TOKEN=$(gh config get -h github.com oauth_token)
KAMAL_REGISTRY_PASSWORD=$(kamal secrets extract REGISTRY_PASSWORD $SECRETS)
SECRET_KEY_BASE=$(kamal secrets extract SECRET_KEY_BASE $SECRETS)
+1
View File
@@ -1,4 +1,5 @@
SECRETS=$(kamal secrets fetch --adapter 1password --account basecamp --from Deploy/Fizzy Deployments/REGISTRY_PASSWORD Production/SECRET_KEY_BASE)
GITHUB_TOKEN=$(gh config get -h github.com oauth_token)
KAMAL_REGISTRY_PASSWORD=$(kamal secrets extract REGISTRY_PASSWORD $SECRETS)
SECRET_KEY_BASE=$(kamal secrets extract SECRET_KEY_BASE $SECRETS)
+2 -1
View File
@@ -23,7 +23,8 @@ RUN apt-get update -qq && \
# Install application gems
COPY Gemfile Gemfile.lock .ruby-version ./
RUN bundle install && \
RUN --mount=type=secret,id=GITHUB_TOKEN \
BUNDLE_GITHUB__COM="$(cat /run/secrets/GITHUB_TOKEN):x-oauth-basic" bundle install && \
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \
bundle exec bootsnap precompile --gemfile
+2
View File
@@ -19,6 +19,8 @@ registry:
builder:
arch: amd64
secrets:
- GITHUB_TOKEN
env:
secret: