-
-
Notifications
You must be signed in to change notification settings - Fork 28
69 lines (61 loc) · 2.08 KB
/
cicd.yml
File metadata and controls
69 lines (61 loc) · 2.08 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
name: CICD
on:
workflow_dispatch:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled
push:
branches:
- main
tags:
- "v*.*.*" # Trigger on semantic version tags like v1.0.0
concurrency:
group: cicd-${{ github.ref_name == 'main' && 'main' || github.ref_name }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
build:
uses: ./.github/workflows/build.yml
secrets: inherit
test:
needs: build
uses: ./.github/workflows/test.yml
with:
skip-tests: ${{ contains(github.event.pull_request.labels.*.name, 'skip-tests') }}
push:
needs: [build]
uses: ./.github/workflows/push.yml
with:
activitypub-private-tags: ${{ needs.build.outputs.activitypub-private-tags }}
activitypub-public-tags: ${{ needs.build.outputs.activitypub-public-tags }}
activitypub-public-labels: ${{ needs.build.outputs.activitypub-public-labels }}
activitypub-migrations-private-tags: ${{ needs.build.outputs.activitypub-migrations-private-tags }}
activitypub-migrations-public-tags: ${{ needs.build.outputs.activitypub-migrations-public-tags }}
activitypub-migrations-public-labels: ${{ needs.build.outputs.activitypub-migrations-public-labels }}
deploy-pr:
needs: [push, test]
if: github.event_name == 'pull_request'
uses: ./.github/workflows/deploy-pr.yml
secrets: inherit
deploy:
needs: [push, test]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: ./.github/workflows/deploy.yml
secrets: inherit
with:
github-sha: ${{ github.sha }}
slack-notify:
name: Slack Notification on Failure
needs: [build, test, push, deploy]
runs-on: ubuntu-latest
if: always()
steps:
- uses: tryghost/actions/actions/slack-build@f13ff0145a6bf9c32a41a5bb5b638e1b5f0a51dd # main
if: contains(needs.*.result, 'failure') && github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
status: failure
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}