Skip to content

Commit

Permalink
Update builds.yml workflow to only push to private registry
Browse files Browse the repository at this point in the history
  • Loading branch information
sjonpaulbrown committed Dec 19, 2024
1 parent 85e1872 commit 148aeb1
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ on:
type: boolean
description: 'Build amd64 `without_adx` and `without_netgo_without_adx` images, and arm64 images'
required: false
private_build:
type: boolean
description: 'Build private images'
required: false

jobs:
# matrix_builder generates a matrix that includes the roles selected in the input
Expand Down Expand Up @@ -86,7 +82,7 @@ jobs:
docker-push:
name: ${{ matrix.role }} images
runs-on: ubuntu-latest
environment: Production Docker Registry
environment: Private Registry Builds
needs: matrix_builder

# setup jobs for each role
Expand All @@ -110,33 +106,20 @@ jobs:
- id: auth
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCR_SERVICE_KEY_SECRET }}
credentials_json: ${{ secrets.PRIVATE_REGISTRY_UPLOAD_SECRET }}
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1

- name: Authenticate Docker with gcloud
run: |
if [[ "${{ github.event.inputs.private_build }}" == "true" ]]; then
gcloud auth configure-docker us-central1-docker.pkg.dev
else
gcloud auth configure-docker
fi
- name: Set CONTAINER_REGISTRY
id: set-registry
run: |
if [[ "${{ github.event.inputs.private_build }}" == "true" ]]; then
echo "CONTAINER_REGISTRY=${{ vars.PRIVATE_REGISTRY }}" >> $GITHUB_ENV
else
echo "CONTAINER_REGISTRY=${{ vars.PUBLIC_REGISTRY }}" >> $GITHUB_ENV
fi
gcloud auth configure-docker us-central1-docker.pkg.dev
- name: Build/Push ${{ matrix.role }} amd64 images with adx (default)
env:
IMAGE_TAG: ${{ inputs.docker_tag }}
CADENCE_DEPLOY_KEY: ${{ secrets.CADENCE_DEPLOY_KEY }}
run: |
make docker-build-${{ matrix.role }}-with-adx docker-push-${{ matrix.role }}-with-adx CONTAINER_REGISTRY=$CONTAINER_REGISTRY
make docker-build-${{ matrix.role }}-with-adx docker-push-${{ matrix.role }}-with-adx CONTAINER_REGISTRY=${{ vars.PRIVATE_REGISTRY }}
- name: Build/Push ${{ matrix.role }} amd64 images without netgo and without adx, arm64 images
if: ${{ inputs.include_alternative_builds }}
Expand All @@ -146,7 +129,5 @@ jobs:
run: |
make docker-build-${{ matrix.role }}-without-adx docker-push-${{ matrix.role }}-without-adx \
docker-build-${{ matrix.role }}-without-netgo-without-adx docker-push-${{ matrix.role }}-without-netgo-without-adx \
docker-cross-build-${{ matrix.role }}-arm docker-push-${{ matrix.role }}-arm CONTAINER_REGISTRY=$CONTAINER_REGISTRY
docker-cross-build-${{ matrix.role }}-arm docker-push-${{ matrix.role }}-arm CONTAINER_REGISTRY=${{ vars.PRIVATE_REGISTRY }}

0 comments on commit 148aeb1

Please sign in to comment.