Skip to content

Commit

Permalink
Fix artifact publishing
Browse files Browse the repository at this point in the history
Merge push and release workflows into ci workflow in order
to correctly publish artifacts from the build pipeline.

Signed-off-by: SuperQ <[email protected]>
  • Loading branch information
SuperQ committed Dec 28, 2024
1 parent 718451e commit de78016
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 44 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
18 changes: 0 additions & 18 deletions .github/workflows/push.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/release.yml

This file was deleted.

0 comments on commit de78016

Please sign in to comment.