diff --git a/.github/workflows/build-docker-images.yml b/.github/workflows/build-docker-images.yml index cf5086f29..3a3ec9d4f 100644 --- a/.github/workflows/build-docker-images.yml +++ b/.github/workflows/build-docker-images.yml @@ -32,9 +32,7 @@ jobs: dockerfile: docker/Frontend.Dockerfile uses: ./.github/workflows/build-docker.yml with: - old_registry: ${{ github.ref_name == 'main' && 'fruoccopublic.azurecr.io' }} new_registry: 'cwydcontainerreg.azurecr.io' - old_username: ${{ github.ref_name == 'main' && 'fruoccopublic' }} new_username: 'cwydcontainerreg' app_name: ${{ matrix.app_name }} dockerfile: ${{ matrix.dockerfile }} diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 0ae7100e4..cc79d7de9 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -3,12 +3,6 @@ name: Reusable Docker build and push workflow on: workflow_call: inputs: - old_registry: - required: true - type: string - old_username: - required: true - type: string new_registry: required: true type: string @@ -37,15 +31,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - # Login for 'main' branch to both registries - - name: Docker Login to fruoccopublic (Main) - if: ${{ inputs.push == true && github.ref_name == 'main' }} - uses: docker/login-action@v3 - with: - registry: ${{ inputs.old_registry }} - username: ${{ inputs.old_username }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Docker Login to cwydcontainerreg (Main) if: ${{ inputs.push == true && github.ref_name == 'main' }} uses: docker/login-action@v3 @@ -70,18 +55,6 @@ jobs: id: date run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT - - name: Build Docker Image and optionally push (Old Registry) - if: ${{ github.ref_name == 'main' }} - uses: docker/build-push-action@v6 - with: - context: . - file: ${{ inputs.dockerfile }} - push: ${{ inputs.push }} - cache-from: type=registry,ref=${{ inputs.old_registry }}/${{ inputs.app_name }}:${{ github.ref_name == 'main' && 'latest' || github.head_ref || github.ref_name }} - tags: | - ${{ inputs.old_registry }}/${{ inputs.app_name }}:${{ github.ref_name == 'main' && 'latest' || github.head_ref || 'default' }} - ${{ inputs.old_registry }}/${{ inputs.app_name }}:${{ steps.date.outputs.date }}_${{ github.run_number }} - - name: Build Docker Image and optionally push (New Registry) if: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo'|| github.ref_name == 'dependabotchanges' }} uses: docker/build-push-action@v6