-
Notifications
You must be signed in to change notification settings - Fork 749
81 lines (73 loc) · 2.8 KB
/
on_master.yaml
File metadata and controls
81 lines (73 loc) · 2.8 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: CI (master)
on:
push:
branches:
- master
tags-ignore:
- "**" # Ignore all tags to avoid duplicate executions triggered by tag pushes.
permissions:
contents: read
jobs:
doc_checks:
name: Doc checks
uses: ./.github/workflows/_check_docs.yaml
doc_release:
# Skip this for non-"docs" commits.
if: startsWith(github.event.head_commit.message, 'docs')
name: Doc release
needs: [doc_checks]
permissions:
contents: write
pages: write
id-token: write
uses: ./.github/workflows/manual_release_docs.yaml
with:
# This workflow has its own notify_on_failure; suppress the nested one to avoid duplicate alerts.
suppress_failure_notification: true
secrets: inherit
code_checks:
name: Code checks
uses: ./.github/workflows/_check_code.yaml
tests:
# Skip this for "docs" commits.
if: "!startsWith(github.event.head_commit.message, 'docs')"
name: Tests
uses: ./.github/workflows/_tests.yaml
secrets: inherit
# The beta release is dispatched as a separate workflow run (instead of calling `manual_release_beta.yaml` via `uses:`)
# because PyPI's Trusted Publishing does not currently support reusable workflows.
# See: https://docs.pypi.org/trusted-publishers/troubleshooting/#reusable-workflows-on-github
beta_release:
# Run this only for "feat", "fix", "perf", "refactor" and "style" commits.
if: >-
startsWith(github.event.head_commit.message, 'feat') ||
startsWith(github.event.head_commit.message, 'fix') ||
startsWith(github.event.head_commit.message, 'perf') ||
startsWith(github.event.head_commit.message, 'refactor') ||
startsWith(github.event.head_commit.message, 'style')
name: Beta release
needs: [code_checks, tests]
runs-on: ubuntu-latest
permissions:
actions: write # Required by execute-workflow.
steps:
- name: Dispatch beta release workflow
uses: apify/actions/execute-workflow@v1.1.2
with:
workflow: manual_release_beta.yaml
# Send a Slack notification to the team alerting channel when there is a failure.
# Note: `beta_release` is a fire-and-forget dispatcher (it only kicks off `manual_release_beta.yaml`
# via execute-workflow). Failures inside the dispatched beta run are caught by that workflow's own
# `notify_on_failure`, not by this one.
notify_on_failure:
name: Notify Slack on failure
needs: [doc_checks, doc_release, code_checks, tests, beta_release]
if: failure()
permissions:
contents: read
actions: read # Required for `gh api ...actions/runs/.../jobs` inside the reusable workflow.
uses: ./.github/workflows/_notify_slack_on_failure.yaml
with:
heading: ':red_circle: Master CI failed'
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}