-
Notifications
You must be signed in to change notification settings - Fork 7
119 lines (118 loc) · 4.35 KB
/
release-spec-runner.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: 'Release Runner: Start the Release Process for DEV, QA, STAGING and PROD'
on:
workflow_dispatch:
inputs:
env_to_release:
description: 'List of environments to release the OpenAPI Spec to.'
type: choice
options:
- dev
- qa
- staging
- prod
- dev,qa,staging,prod
- dev,qa,staging
- dev,qa
default: 'dev'
required: false
schedule:
- cron: '0 * * * 1-5' # Run every hour from Monday to Friday
permissions:
contents: write
pull-requests: write
issues: write
jobs:
release-preparation:
name: Release Preparation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
ref: main
token: ${{secrets.api_bot_pat}}
sparse-checkout: |
.github
# We upload the scripts in .github/scripts/* (defined only in main) so that they can be downloaded and reused
# when releasing in all the branches.
- name: Upload release scripts
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
with:
name: release-scripts
retention-days: 1
path: .github/scripts/*
release-spec-dev:
name: Release OpenAPI Spec for DEV
needs: release-preparation
if: >-
github.event_name == 'schedule' || contains(inputs.env_to_release, 'dev')
uses: ./.github/workflows/release-spec.yml
secrets:
api_bot_pat: ${{ secrets.API_BOT_PAT }}
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID_DEV }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }}
jira_api_token: ${{ secrets.JIRA_API_TOKEN }}
with:
aws_default_region: ${{ vars.AWS_DEFAULT_REGION}}
aws_s3_bucket: ${{ vars.S3_BUCKET_DEV}}
env: dev
branch: dev
spectral_version: ${{ vars.SPECTRAL_VERSION }}
foascli_version: ${{ vars.FOASCLI_VERSION }}
release-spec-qa:
name: Release OpenAPI Spec for QA
needs: release-preparation
if: >-
github.event_name == 'schedule' || contains(inputs.env_to_release, 'qa')
uses: ./.github/workflows/release-spec.yml
secrets:
api_bot_pat: ${{ secrets.API_BOT_PAT }}
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID_QA }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY_QA }}
jira_api_token: ${{ secrets.JIRA_API_TOKEN }}
with:
aws_default_region: ${{ vars.AWS_DEFAULT_REGION}}
aws_s3_bucket: ${{ vars.S3_BUCKET_QA}}
env: qa
branch: qa
spectral_version: ${{ vars.SPECTRAL_VERSION }}
foascli_version: ${{ vars.FOASCLI_VERSION }}
release-spec-staging:
name: Release OpenAPI Spec for STAGING
needs: release-preparation
if: >-
github.event_name == 'schedule' || contains(inputs.env_to_release, 'staging')
uses: ./.github/workflows/release-spec.yml
secrets:
api_bot_pat: ${{ secrets.API_BOT_PAT }}
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID_STAGING }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY_STAGING }}
jira_api_token: ${{ secrets.JIRA_API_TOKEN }}
with:
aws_default_region: ${{ vars.AWS_DEFAULT_REGION}}
aws_s3_bucket: ${{ vars.S3_BUCKET_STAGING}}
env: stage
branch: staging
spectral_version: ${{ vars.SPECTRAL_VERSION }}
foascli_version: ${{ vars.FOASCLI_VERSION }}
release-spec-prod:
name: Release OpenAPI Spec for PROD
needs: release-preparation
if: >-
github.event_name == 'schedule' || contains(inputs.env_to_release, 'prod')
uses: ./.github/workflows/release-spec.yml
secrets:
api_bot_pat: ${{ secrets.API_BOT_PAT }}
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID_PROD }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY_PROD }}
postman_api_key: ${{ secrets.POSTMAN_API_KEY }}
workspace_id: ${{ secrets.WORKSPACE_ID }}
jira_api_token: ${{ secrets.JIRA_API_TOKEN }}
with:
aws_default_region: ${{ vars.AWS_DEFAULT_REGION}}
aws_s3_bucket: ${{ vars.S3_BUCKET_PROD}}
env: prod
branch: main
spectral_version: ${{ vars.SPECTRAL_VERSION }}
foascli_version: ${{ vars.FOASCLI_VERSION }}
atlas_prod_base_url: ${{ vars.ATLAS_PROD_BASE_URL }}