From b40f9b378153d0cda2335d38d46117dfad1bbc98 Mon Sep 17 00:00:00 2001 From: shipperizer Date: Mon, 20 May 2024 10:59:41 +0100 Subject: [PATCH] ci: standardize ci --- .github/workflows/ci.yaml | 13 ++++++++++--- README.md | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0f426ff6..0bafef71 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -6,11 +6,18 @@ name: CI # * scan the image and upload the artifacts to the repository on: - pull_request: push: + branches: + - "main" + - "release-**" + tags: + - "v**" paths: - "rockcraft.yaml" - ".github/workflows/**.yaml" + pull_request: + branches: + - "*" workflow_dispatch: jobs: @@ -18,11 +25,11 @@ jobs: uses: ./.github/workflows/build.yaml publish: - if: github.ref == 'refs/heads/main' + if: ${{ (github.ref == 'refs/heads/main') || (github.ref_type == 'tag') }} needs: build uses: ./.github/workflows/publish.yaml scan: - if: github.ref == 'refs/heads/main' + if: ${{ (github.ref == 'refs/heads/main') || (github.ref_type == 'tag') }} needs: publish uses: ./.github/workflows/scan.yaml diff --git a/README.md b/README.md index f16eafdf..5eca6e02 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ![Latest Version](https://img.shields.io/badge/dynamic/yaml?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcanonical%2Fhydra-rock%2Fmain%2Frockcraft.yaml&query=%24.version&label=Release&color=red) [![License](https://img.shields.io/github/license/canonical/hydra-rock?label=License)](https://github.com/canonical/hydra-rock/blob/main/LICENSE) -[![CI](https://github.com/canonical/hydra-rock/actions/workflows/ci.yaml/badge.svg)](https://github.com/canonical/hydra-rock/actions/workflows/ci.yaml) +[![Release](https://github.com/canonical/hydra-rock/actions/workflows/ci.yaml/badge.svg)](https://github.com/canonical/hydra-rock/actions/workflows/ci.yaml) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit) [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196.svg)](https://conventionalcommits.org)