-
Notifications
You must be signed in to change notification settings - Fork 4
79 lines (70 loc) · 2.52 KB
/
main.yml
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
name: Main
on:
push:
branches:
- '**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
pre-build:
runs-on: ubuntu-20.04
outputs:
tag: ${{ steps.prep.outputs.tag }}
steps:
- uses: actions/checkout@v3
- name: Prepare
id: prep
run: |
TAG=$(echo $GITHUB_SHA | head -c7)
echo "TAG=${TAG}" >> ${GITHUB_ENV}
echo "tag=$TAG" >> $GITHUB_OUTPUT
test:
needs: [pre-build]
if: ${{ github.ref != 'refs/heads/prod' }}
uses: kosli-dev/cli/.github/workflows/test.yml@main
with:
AWS_ACCOUNT_ID: 772819027869
AWS_REGION: eu-central-1
secrets:
github_access_token: ${{ secrets.KOSLI_GITHUB_TOKEN }}
gitlab_access_token: ${{ secrets.KOSLI_GITLAB_TOKEN }}
azure_access_token: ${{ secrets.KOSLI_AZURE_TOKEN }}
bitbucket_password: ${{ secrets.KOSLI_BITBUCKET_PASSWORD }}
jira_api_token: ${{ secrets.KOSLI_JIRA_API_TOKEN }}
slack_webhook: ${{ secrets.MERKELY_SLACK_CI_FAILURES_WEBHOOK }}
slack_channel: ${{ secrets.MERKELY_SLACK_CI_FAILURES_CHANNEL }}
docker:
needs: [pre-build, test]
if: ${{ github.ref != 'refs/heads/prod' }}
uses: kosli-dev/cli/.github/workflows/docker.yml@main
with:
tag: ${{ needs.pre-build.outputs.tag }}
platforms: linux/amd64
secrets:
slack_webhook: ${{ secrets.MERKELY_SLACK_CI_FAILURES_WEBHOOK }}
slack_channel: ${{ secrets.MERKELY_SLACK_CI_FAILURES_CHANNEL }}
ghcr_user: ${{ secrets.GHCR_USER }}
ghcr_token: ${{ secrets.GHCR_TOKEN }}
kosli_api_token: ${{ secrets.KOSLI_API_TOKEN }}
snyk_token: ${{ secrets.SNYK_TOKEN }}
upload-kosli-reporter-package-staging:
needs: [pre-build, test]
if: ${{ github.ref == 'refs/heads/main' }}
uses: kosli-dev/cli/.github/workflows/upload-reporter-package.yml@main
with:
tag: ${{ needs.pre-build.outputs.tag }}
s3_name: reporter-lambda-stagingdacef8339fbd41ce31c346f854a85d0c74f7c4e8
AWS_ACCOUNT_ID: 772819027869
AWS_REGION: eu-central-1
deploy-staging-reporters:
runs-on: ubuntu-20.04
needs: [pre-build, upload-kosli-reporter-package-staging]
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.KOSLI_REPORTER_REPO_ACCESS_TOKEN }}
repository: kosli-dev/kosli-reporter
event-type: deploy-reporter
client-payload: '{"env": "staging", "tag": "${{ needs.pre-build.outputs.tag }}"}'