-
Notifications
You must be signed in to change notification settings - Fork 34
58 lines (52 loc) · 2.23 KB
/
cd.yaml
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
# The CD pipline should be disabled now.
name: CD
on:
workflow_run:
workflows: ["CI"]
branches: [main]
types:
- completed
jobs:
deploy_to_dev:
runs-on: ubuntu-latest
environment: dev
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download Image Tags
uses: dawidd6/action-download-artifact@v2
with:
name: image_tags
workflow: ci.yml
run_id: ${{ github.event.workflow_run.id}}
path: ${{ github.workspace }}
- name: Download Manifests
uses: dawidd6/action-download-artifact@v2
with:
name: manifests
workflow: ci.yml
run_id: ${{ github.event.workflow_run.id}}
path: ${{ github.workspace }}
- name: Read Image Tags
run: |
echo "IMAGE_TAG=$(cat ${{ github.workspace }}/IMAGE_TAG)" >> $GITHUB_ENV
- name: Generate Manifests
run: |
.github/workflows/utils/generate-manifests.sh ${{ github.workspace }}/manifests gen_manifests all
env:
APP_BUILD_VERSION: ${{ env.IMAGE_TAG }}
GIT_REPOSITORY_TYPE: ${{ secrets.GIT_REPOSITORY_TYPE }}
CICD_ORCHESTRATOR_TYPE: ${{ secrets.CICD_ORCHESTRATOR_TYPE }}
GITOPS_OPERATOR_TYPE: ${{ secrets.GITOPS_OPERATOR_TYPE }}
GITHUB_GITOPS_REPO_NAME: ${{ secrets.GH_GITOPS_REPO_NAME }}
GITHUB_GITOPS_MANIFEST_REPO_NAME: ${{ secrets.GH_GITOPS_MANIFEST_REPO_NAME }}
GITHUB_ORG_URL: ${{ secrets.GH_ORG_URL }}
GITOPS_APP_URL: ${{ secrets.GITOPS_APP_URL }}
AZDO_GITOPS_REPO_NAME: ${{ secrets.AZDO_GITOPS_REPO_NAME }}
AZDO_PR_REPO_NAME: ${{ secrets.AZDO_PR_REPO_NAME }}
AZDO_ORG_URL: ${{ secrets.AZDO_ORG_URL }}
ORCHESTRATOR_PAT: ${{ secrets.ORCHESTRATOR_PAT }}
- name: Create PR
run: |
.github/workflows/utils//create-pr.sh -s ${{ github.workspace }}/gen_manifests -d ${{ secrets.MANIFESTS_FOLDER }} -r ${{ secrets.MANIFESTS_REPO }} -b ${{ secrets.MANIFESTS_BRANCH }} -i ${{ github.event.workflow_run.id}} -t ${{ secrets.MANIFESTS_PAT }} -e ${{ secrets.ENVIRONMENT_NAME }}