diff --git a/.github/workflows/release-container.yml b/.github/workflows/release-container.yml index ccfc6352f3..c08b2a1a8d 100644 --- a/.github/workflows/release-container.yml +++ b/.github/workflows/release-container.yml @@ -19,16 +19,6 @@ - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - - name: Container metadata - id: meta - uses: docker/metadata-action@v4 - with: - images: quay.io/keycloak/keycloak - tags: | - type=ref,event=branch - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - name: Login to Quay uses: docker/login-action@v2 @@ -37,7 +27,25 @@ username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_TOKEN }} - - name: Build and push + - name: Login to Docker + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: Container metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: | + keycloak/keycloak + quay.io/keycloak/keycloak + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + + - name: Build and push the image uses: docker/build-push-action@v3 with: context: quarkus/container diff --git a/.github/workflows/release-operator-container.yml b/.github/workflows/release-operator-container.yml index 060dbae914..aeb2f949f2 100644 --- a/.github/workflows/release-operator-container.yml +++ b/.github/workflows/release-operator-container.yml @@ -18,23 +18,6 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Container metadata - id: meta - uses: docker/metadata-action@v4 - with: - images: quay.io/keycloak/keycloak-operator - tags: | - type=ref,event=branch - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - - - name: Login to Quay - uses: docker/login-action@v2 - with: - registry: quay.io - username: ${{ secrets.QUAY_USERNAME }} - password: ${{ secrets.QUAY_TOKEN }} - - uses: actions/setup-java@v3 with: distribution: 'temurin' @@ -43,9 +26,35 @@ jobs: - name: Build locally Keycloak artifacts to avoid depending on Maven run: | - mvn -P operator -pl operator -am clean install -DskipTests + mvn -P operator -pl operator -am clean install -DskipTests - - name: Build the operator Docker image + - name: Login to Quay + uses: docker/login-action@v2 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_TOKEN }} + + - name: Login to Docker + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + logout: true + + - name: Container metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: | + keycloak/keycloak-operator + quay.io/keycloak/keycloak-operator + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + + - name: Build and push the operator image working-directory: operator run: | echo "${{ steps.meta.outputs.tags }}" | xargs -I {} \