diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 626c53a..d14f093 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,9 +4,6 @@ on: push: branches: - 'main' - # - 'staging' - # - 'dev' - # - 'hotfix/**' jobs: build: runs-on: ubuntu-latest @@ -43,3 +40,44 @@ jobs: file: Dockerfile push: true tags: quay.io/denbicloud/cron-backup:${{ steps.tag.outputs.TAG }} + + special_builds: + runs-on: ubuntu-latest + needs: build + strategy: + fail-fast: false + matrix: + type: [ postgresql, mysql, mongodb ] + steps: + + - name: Extract branch name + shell: bash + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + id: extract_branch + + - name: Set tag + run: sed 's/\//-/g' <<< "::set-output name=TAG::${{ steps.extract_branch.outputs.branch }}" + id: tag + + - name: Get tag + run: echo "The selected tag is ${{ steps.tag.outputs.TAG }}" + + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Quay.io + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_TOKEN }} + - name: Build and publish image to Quay + uses: docker/build-push-action@v5 + env: + BASE_TAG: ${{ steps.tag.outputs.TAG }} + with: + file: ${{matrix.type}}/Dockerfile + context: ${{matrix.type}} + push: true + build-args: BASE_TAG + tags: quay.io/denbicloud/cron-backup:${{matrix.type}}-${{ steps.get_version.outputs.VERSION }}