diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e6f86e3..73977a5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,3 +27,37 @@ jobs: - run: make build - name: Verify example configs run: find ./examples -name "*.yml" -print0 | xargs -0 -I % ./yace verify-config -config.file % + + publish_master: + name: Publish master branch artifacts + runs-on: ubuntu-latest + needs: [build, verify-example-configs] + if: github.event_name == 'push' && github.event.ref == 'refs/heads/master' + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: prometheus/promci@52c7012f5f0070d7281b8db4a119e21341d43c91 # v0.4.5 + - uses: ./.github/promci/actions/publish_master + with: + docker_hub_login: ${{ secrets.docker_hub_login }} + docker_hub_password: ${{ secrets.docker_hub_password }} + quay_io_login: ${{ secrets.quay_io_login }} + quay_io_password: ${{ secrets.quay_io_password }} + + publish_release: + name: Publish release artefacts + runs-on: ubuntu-latest + needs: [build, verify-example-configs] + if: | + (github.repository == 'prometheus-community/yet-another-cloudwatch-exporter') + && + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v.')) + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: prometheus/promci@52c7012f5f0070d7281b8db4a119e21341d43c91 # v0.4.5 + - uses: ./.github/promci/actions/publish_release + with: + docker_hub_login: ${{ secrets.docker_hub_login }} + docker_hub_password: ${{ secrets.docker_hub_password }} + quay_io_login: ${{ secrets.quay_io_login }} + quay_io_password: ${{ secrets.quay_io_password }} + github_token: ${{ secrets.PROMBOT_GITHUB_TOKEN }} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml deleted file mode 100644 index 68f9e69a..00000000 --- a/.github/workflows/push.yml +++ /dev/null @@ -1,18 +0,0 @@ -on: push - -name: Build and test -jobs: - buildDockerImage: - name: Publish master branch artifacts - runs-on: ubuntu-latest - needs: [build, verify] - if: github.event_name == 'push' && github.event.ref == 'refs/heads/master' - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: prometheus/promci@52c7012f5f0070d7281b8db4a119e21341d43c91 # v0.4.5 - - uses: ./.github/promci/actions/publish_master - with: - docker_hub_login: ${{ secrets.docker_hub_login }} - docker_hub_password: ${{ secrets.docker_hub_password }} - quay_io_login: ${{ secrets.quay_io_login }} - quay_io_password: ${{ secrets.quay_io_password }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 4dcb9087..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Publish Docker image and binaries - -on: - push: - tags: - - 'v*' - -jobs: - buildDockerImage: - name: Publish release artefacts - runs-on: ubuntu-latest - needs: [build, verify] - if: | - (github.repository == 'prometheus-community/yet-another-cloudwatch-exporter') - && - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v.')) - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: prometheus/promci@52c7012f5f0070d7281b8db4a119e21341d43c91 # v0.4.5 - - uses: ./.github/promci/actions/publish_release - with: - docker_hub_login: ${{ secrets.docker_hub_login }} - docker_hub_password: ${{ secrets.docker_hub_password }} - quay_io_login: ${{ secrets.quay_io_login }} - quay_io_password: ${{ secrets.quay_io_password }} - github_token: ${{ secrets.PROMBOT_GITHUB_TOKEN }}