From a8d453b2478a52a32c3459a522eecdc47be4ba88 Mon Sep 17 00:00:00 2001 From: hstefans Date: Mon, 16 Oct 2023 11:53:53 +0200 Subject: [PATCH] extend release workflow to push to quay --- .../{release-github.yaml => release.yaml} | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) rename .github/workflows/{release-github.yaml => release.yaml} (78%) diff --git a/.github/workflows/release-github.yaml b/.github/workflows/release.yaml similarity index 78% rename from .github/workflows/release-github.yaml rename to .github/workflows/release.yaml index f28f82535..12cf1f57d 100644 --- a/.github/workflows/release-github.yaml +++ b/.github/workflows/release.yaml @@ -63,6 +63,19 @@ jobs: --source="${{ github.event.repository.html_url }}" \ --revision="${GITHUB_REF_NAME}/${GITHUB_SHA}" + - name: Login to Quay Container Registry + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + - name: Publish Kustomize OCI artifact to GHCR + run: | + flux push artifact ${{ env.KUSTOMIZE_REPO }}:${{ github.ref_name }} \ + --path="./deploy/kustomize" \ + --source="${{ github.event.repository.html_url }}" \ + --revision="${GITHUB_REF_NAME}/${GITHUB_SHA}" + image: runs-on: ubuntu-latest steps: @@ -78,6 +91,13 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Login to Quay.io + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + - uses: actions/setup-go@v4 with: go-version-file: "go.mod" @@ -89,19 +109,21 @@ jobs: - name: Prepare run: | - # OCI standard enforces lower-case paths - GHCR_REPO=$(echo "ghcr.io/${{ github.repository }}" | tr '[:upper:]' '[:lower:]') - echo "GHCR_REPO=$GHCR_REPO" >> $GITHUB_ENV echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV - name: Build and push - env: - KO_DOCKER_REPO: ${{ env.GHCR_REPO }} run: | - ko build --sbom=none --bare --platform linux/arm64,linux/arm/v7,linux/amd64 -t ${{ github.ref_name }} \ + declare -a arr=("quay.io" "ghcr.io" ) + + for i in "${arr[@]}" + do + KO_DOCKER_REPO=${i}/grafana-operator/grafana-operator + ko build --sbom=none --bare --platform linux/arm64,linux/arm/v7,linux/amd64 -t ${{ github.ref_name }} \ --image-label org.opencontainers.image.title=grafana-operator \ --image-label org.opencontainers.image.description="An operator for Grafana that installs and manages Grafana instances & Dashboards & Datasources through Kubernetes/OpenShift CRs" \ --image-label org.opencontainers.image.url=${{ github.server_url }}/${{ github.repository }} \ --image-label org.opencontainers.image.revision=${{ github.sha }} \ --image-label org.opencontainers.image.version=${{ github.ref_name }} \ --image-label org.opencontainers.image.created=${{ env.BUILD_DATE }} + done +