diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 23ee0d9763..f4d9f682f5 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -14,7 +14,7 @@ jobs: name: Prepare E2E configuration and image runs-on: ubuntu-latest env: - DOCKER_REPO: mongodb/mongodb-atlas-kubernetes-operator-prerelease + GHCR_REPO: ghcr.io/${{ github.repository_owner }}/mongodb-atlas-kubernetes-operator-prerelease steps: - if: ${{ inputs.forked == false }} name: Check out code @@ -33,23 +33,26 @@ jobs: - name: Prepare tag id: prepare uses: ./.github/actions/set-tag - - name: Build and Push image - uses: ./.github/actions/build-push-image + - name: Log in to ghcr.io registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin + - name: Build and Push to ${{ steps.prepare.outputs.tag }} + uses: docker/build-push-action@v3 with: - repository: ${{ env.DOCKER_REPO }} - version: ${{ steps.prepare.outputs.tag }} + context: . + file: Dockerfile + build-args: VERSION=${{ steps.prepare.outputs.tag }} platforms: linux/amd64 - docker_username: ${{ secrets.DOCKER_USERNAME }} - docker_password: ${{ secrets.DOCKER_PASSWORD }} - push_to_quay: false - forked: ${{ inputs.forked }} + cache-from: type=gha + cache-to: type=gha,mode=max + sbom: true + push: true + tags: ${{ steps.prepare.outputs.tag }} prepare-e2e-bundle: name: Prepare E2E Bundle configuration and image runs-on: ubuntu-latest env: - DOCKER_REGISTRY: docker.io - DOCKER_REPO: mongodb/mongodb-atlas-kubernetes-operator-prerelease - DOCKER_BUNDLES_REPO: mongodb/mongodb-atlas-kubernetes-bundles-prerelease + GHCR_REPO: ghcr.io/mongodb/mongodb-atlas-kubernetes-operator-prerelease + GHCR_BUNDLES_REPO: ghcr.io/mongodb/mongodb-atlas-kubernetes-bundles-prerelease steps: - if: ${{ inputs.forked == false }} name: Check out code @@ -71,7 +74,7 @@ jobs: - name: Generate configuration for the tests uses: ./.github/actions/gen-install-scripts with: - IMAGE_URL: ${{ env.DOCKER_REPO }}:${{ steps.prepare.outputs.tag }} + IMAGE_URL: ${{ env.GHCR_REPO }}:${{ steps.prepare.outputs.tag }} VERSION: ${{ steps.prepare.outputs.tag }} ENV: dev - name: Change path for the test @@ -99,31 +102,31 @@ jobs: - name: Prepare docker tag id: prepare-docker-bundle-tag run: | - REPOSITORY=${{ env.DOCKER_BUNDLES_REPO }} + REPOSITORY=${{ env.GHCR_BUNDLES_REPO }} TAG=${{ steps.prepare.outputs.tag }} TAGS="${REPOSITORY}:${TAG}" echo "tags=$TAGS" >> $GITHUB_OUTPUT + - name: Log in to ghcr.io registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin - name: Build and Push image - uses: ./.github/actions/build-push-image + uses: docker/build-push-action@v3 with: - get-existing-cache: true + context: . file: bundle.Dockerfile - repository: ${{ env.DOCKER_BUNDLES_REPO }} - version: ${{ steps.prepare.outputs.tag }} + build-args: VERSION=${{ steps.prepare.outputs.tag }} platforms: linux/amd64 - push_to_docker: false - push_to_quay: true - quay_username: mongodb+mongodb_atlas_kubernetes - quay_password: ${{ secrets.QUAY_PASSWORD }} - forked: ${{ inputs.forked }} + cache-from: type=gha + cache-to: type=gha,mode=max + sbom: true + push: true + tags: ${{ steps.prepare.outputs.tag }} e2e: name: E2E tests needs: [prepare-e2e, prepare-e2e-bundle] runs-on: ubuntu-latest env: - DOCKER_REGISTRY: docker.io - DOCKER_REPO: mongodb/mongodb-atlas-kubernetes-operator-prerelease - DOCKER_BUNDLES_REPO: quay.io/mongodb/mongodb-atlas-kubernetes-bundles-prerelease + GHCR_REPO: ghcr.io/mongodb/mongodb-atlas-kubernetes-operator-prerelease + GHCR_BUNDLES_REPO: ghcr.io/mongodb/mongodb-atlas-kubernetes-bundles-prerelease strategy: fail-fast: false matrix: @@ -198,7 +201,7 @@ jobs: - name: Generate configuration for the tests uses: ./.github/actions/gen-install-scripts with: - IMAGE_URL: ${{ env.DOCKER_REPO }}:${{ steps.prepare.outputs.tag }} + IMAGE_URL: ${{ env.GHCR_REPO }}:${{ steps.prepare.outputs.tag }} VERSION: ${{ steps.prepare.outputs.tag }} ENV: dev @@ -236,13 +239,11 @@ jobs: MCLI_PRIVATE_API_KEY: ${{ secrets.ATLAS_PRIVATE_KEY }} MCLI_ORG_ID: ${{ secrets.ATLAS_ORG_ID}} MCLI_OPS_MANAGER_URL: "https://cloud-qa.mongodb.com/" - IMAGE_URL: "${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_REPO }}:${{ steps.prepare.outputs.tag }}" - BUNDLE_IMAGE: "${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_BUNDLES_REPO}}:${{ steps.prepare.outputs.tag }}" + IMAGE_URL: "${{ env.GHCR_REPO }}:${{ steps.prepare.outputs.tag }}" + BUNDLE_IMAGE: "${{ env.GHCR_BUNDLES_REPO}}:${{ steps.prepare.outputs.tag }}" K8S_PLATFORM: "${{ steps.properties.outputs.k8s_platform }}" K8S_VERSION: "${{ steps.properties.outputs.k8s_version }}" TEST_NAME: "${{ matrix.test }}" - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} OPENSHIFT_USER: ${{ secrets.OPENSHIFT_USER }} OPENSHIFT_PASS: ${{ secrets.OPENSHIFT_PASS }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}