Skip to content

Commit

Permalink
Make things more complicated for GHCR
Browse files Browse the repository at this point in the history
  • Loading branch information
matz-e committed Dec 4, 2024
1 parent 98a633b commit 9dc7475
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .github/actions/build_container/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ inputs:
DOCKERHUB_PASSWORD:
description: Password for Dockerhub authentication
required: true
GHCR_USER:
description: Username for GHCR authentication
required: true
GHCR_TOKEN:
description: Token for GHCR authentication
required: true
SPACK_DEPLOYMENT_KEY_PUB:
description: Public key for spack deployments
required: true
Expand All @@ -50,6 +56,7 @@ runs:
echo "${{ inputs.SPACK_DEPLOYMENT_KEY_PRIVATE }}" > ${{ inputs.BUILD_PATH }}/key
aws ecr get-login-password --region us-east-1 | buildah login --username AWS --password-stdin ${{ inputs.AWS_ECR_URL }}
buildah login --username ${{ inputs.DOCKERHUB_USER }} --password ${{ inputs.DOCKERHUB_PASSWORD }} docker.io
buildah login --username ${{ inputs.GHCR_USER }} --password ${{ inputs.GHCR_TOKEN }} ghcr.io
# This is written like that in case $BUILDAH_EXTRA_ARGS has args that require spaces,
# which is tricky with shell variable expansion. Similar to Kaniko, see also:
# https://github.com/GoogleContainerTools/kaniko/issues/1803
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/spacktainer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ jobs:
AWS_ECR_PATH: /spacktainers/builder
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ECR_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ECR_SECRET_ACCESS_KEY }}
GHCR_PATH: /BlueBrain/spack-builder
GHCR_USER: ${{ secrets.GHCR_USER }}
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
GHCR_PATH: /bluebrain/spack-builder
BUILD_PATH: builder
BUILDAH_EXTRA_ARGS: --label org.opencontainers.image.revision="$GITHUB_SHA"
--label org.opencontainers.image.authors="$GITHUB_TRIGGERING_ACTOR" --label
Expand Down Expand Up @@ -44,7 +46,9 @@ jobs:
AWS_ECR_PATH: /spacktainers/runtime
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ECR_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ECR_SECRET_ACCESS_KEY }}
GHCR_PATH: /BlueBrain/spack-runtime
GHCR_USER: ${{ secrets.GHCR_USER }}
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
GHCR_PATH: /bluebrain/spack-runtime
BUILD_PATH: runtime
BUILDAH_EXTRA_ARGS: --label org.opencontainers.image.revision="$GITHUB_SHA"
--label org.opencontainers.image.authors="$GITHUB_TRIGGERING_ACTOR" --label
Expand Down Expand Up @@ -97,7 +101,9 @@ jobs:
AWS_ECR_PATH: /spacktainers/${{ matrix.spacktainer }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ECR_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ECR_SECRET_ACCESS_KEY }}
GHCR_PATH: /BlueBrain/spack-${{ matrix.spacktainer }}
GHCR_USER: ${{ secrets.GHCR_USER }}
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
GHCR_PATH: /bluebrain/spack-${{ matrix.spacktainer }}
BUILD_PATH: container_definitions/amd64/${{ matrix.spacktainer }}
BUILDAH_EXTRA_ARGS: --label org.opencontainers.image.revision="$GITHUB_SHA"
--label org.opencontainers.image.authors="$GITHUB_TRIGGERING_ACTOR" --label
Expand Down

0 comments on commit 9dc7475

Please sign in to comment.