CD #96
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 }} | |