1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
name: CD
on:
push:
tags:
- 'v?[0-9]+.[0-9]+.[0-9]+'
- 'v?[0-9]+.[0-9]+.[0-9]+-*'
branches:
- '*'
pull_request:
types: [opened, synchronize, reopened, labeled]
workflow_dispatch:
permissions:
contents: write
jobs:
build-and-release:
name: "${{ startsWith(github.ref, 'refs/tags/') && 'Build and Release' || 'Dry Run' }}"
if: |
startsWith(github.ref, 'refs/tags/') ||
github.ref_name == github.event.repository.default_branch ||
(github.event.pull_request.base.ref == github.event.repository.default_branch && github.event.label.name == 'approved-for-cd')
uses: ecmwf/reusable-workflows/.github/workflows/main-cd.yml@v2
with:
ref_name: ${{ github.ref_name }}
secrets: inherit
|