fix: prd github workflow
This commit is contained in:
parent
1eb4429c5c
commit
2485eb76fa
2 changed files with 74 additions and 68 deletions
3
.github/workflows/cd.yaml
vendored
3
.github/workflows/cd.yaml
vendored
|
|
@ -7,6 +7,7 @@ on:
|
|||
- feature/*
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- 'examples/**'
|
||||
|
||||
env:
|
||||
AWS_ROLE_DEV_CICD: "arn:aws:iam::463722570299:role/cognee-dev-base-role-github-ci-cd"
|
||||
|
|
@ -76,7 +77,7 @@ jobs:
|
|||
script: |
|
||||
await github.rest.actions.createWorkflowDispatch({
|
||||
owner: 'topoteretes',
|
||||
repo: 'PromethAI-Infra',
|
||||
repo: 'cognee-infra',
|
||||
workflow_id: 'terraform.apply.yml',
|
||||
ref: 'main'
|
||||
})
|
||||
|
|
|
|||
139
.github/workflows/cd_prd.yaml
vendored
139
.github/workflows/cd_prd.yaml
vendored
|
|
@ -22,8 +22,9 @@ jobs:
|
|||
id-token: write
|
||||
contents: read
|
||||
steps:
|
||||
- name: Take code from repo
|
||||
uses: actions/checkout@v3
|
||||
- name: Checkout code from repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set environment variable for stage
|
||||
id: set-env
|
||||
run: |
|
||||
|
|
@ -34,68 +35,72 @@ jobs:
|
|||
echo "STAGE=dev" >> $GITHUB_ENV
|
||||
echo "::set-output name=stage::dev"
|
||||
fi
|
||||
# - name: Use output
|
||||
# run: echo "The stage is ${{ steps.set-env.outputs.stage }}"
|
||||
# - name: Configure AWS credentials
|
||||
# uses: aws-actions/configure-aws-credentials@v1
|
||||
# with:
|
||||
# role-to-assume: ${{ env.AWS_ROLE_DEV_CICD }}
|
||||
# aws-region: eu-west-1
|
||||
# - name: Create Docker image and push to ECR
|
||||
# uses: ./.github/actions/image_builder
|
||||
# id: generate-promethai-docker
|
||||
# with:
|
||||
# stage: prd
|
||||
# aws_account_id: ${{ env.AWS_ACCOUNT_ID_DEV }}
|
||||
# should_publish: true
|
||||
# ecr_image_repo_name: promethai-prd-backend-promethai-backend
|
||||
# # ecr_image_repo_name: cognee-prd-backend-cognee-ecr
|
||||
# dockerfile_location: ./
|
||||
# - name: Export Docker image tag
|
||||
# id: export-promethai-docker-tag
|
||||
# run: |
|
||||
# export DOCKER_TAG=$(cat /tmp/.DOCKER_IMAGE_VERSION)
|
||||
# echo "Docker tag is: $DOCKER_TAG"
|
||||
# echo "promethai_docker_tag_backend=$DOCKER_TAG" >> $GITHUB_OUTPUT
|
||||
#
|
||||
## - name: Create Tag and Release
|
||||
## runs-on: ubuntu-latest
|
||||
## uses: actions/checkout@v3
|
||||
## needs: publish_docker_to_ecr # ensure this job runs after Docker image is pushed
|
||||
## steps:
|
||||
## - name: Check out code
|
||||
## uses: actions/checkout@v3
|
||||
## - name: Bump version and push tag
|
||||
## id: bump_version_and_push_tag
|
||||
## uses: anothrNick/github-tag-action@1.34.0
|
||||
## env:
|
||||
## GITHUB_TOKEN: ${{ secrets.PAT_FOR_CROSS_REPOS_CICD_TRIGGERING }}
|
||||
## WITH_V: true
|
||||
## DEFAULT_BUMP: 'minor' # or 'minor' or 'major'
|
||||
## - name: Create Release
|
||||
## id: create_release
|
||||
## uses: actions/create-release@v1
|
||||
## env:
|
||||
## GITHUB_TOKEN: ${{ secrets.PAT_FOR_CROSS_REPOS_CICD_TRIGGERING }}
|
||||
## with:
|
||||
## tag_name: ${{ steps.bump_version_and_push_tag.outputs.tag }}
|
||||
## release_name: Release ${{ steps.bump_version_and_push_tag.outputs.tag }}
|
||||
# outputs:
|
||||
# promethai_docker_tag_backend: ${{ steps.export-promethai-docker-tag.outputs.promethai_docker_tag_backend }}
|
||||
#
|
||||
# apply_tf:
|
||||
# name: Trigger terraform apply workflow
|
||||
# runs-on: ubuntu-latest
|
||||
# needs: publish_docker_to_ecr
|
||||
# steps:
|
||||
# - name: TF apply workflow triggers step
|
||||
# uses: actions/github-script@v6
|
||||
# with:
|
||||
# github-token: ${{ secrets.PAT_FOR_CROSS_REPOS_CICD_TRIGGERING }}
|
||||
# script: |
|
||||
# await github.rest.actions.createWorkflowDispatch({
|
||||
# owner: 'topoteretes',
|
||||
# repo: 'PromethAI-Infra',
|
||||
# workflow_id: 'terraform.apply.yml',
|
||||
# ref: 'main'
|
||||
# })
|
||||
|
||||
- name: Use output
|
||||
run: echo "The stage is ${{ steps.set-env.outputs.stage }}"
|
||||
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@v4
|
||||
with:
|
||||
role-to-assume: ${{ env.AWS_ROLE_DEV_CICD }}
|
||||
aws-region: eu-west-1
|
||||
|
||||
- name: Build Docker image and push to ECR
|
||||
uses: ./.github/actions/image_builder
|
||||
id: generate-promethai-docker
|
||||
with:
|
||||
stage: prd
|
||||
aws_account_id: ${{ env.AWS_ACCOUNT_ID_DEV }}
|
||||
should_publish: true
|
||||
ecr_image_repo_name: cognee-prd-backend-cognee-ecr
|
||||
dockerfile_location: ./
|
||||
|
||||
- name: Export Docker image tag
|
||||
id: export-cognee-docker-tag
|
||||
run: |
|
||||
export DOCKER_TAG=$(cat /tmp/.DOCKER_IMAGE_VERSION)
|
||||
echo "Docker tag is: $DOCKER_TAG"
|
||||
echo "cognee_image_tag=$DOCKER_TAG" >> $GITHUB_OUTPUT
|
||||
|
||||
# - name: Create Tag and Release
|
||||
# runs-on: ubuntu-latest
|
||||
# uses: actions/checkout@v3
|
||||
# needs: publish_docker_to_ecr # ensure this job runs after Docker image is pushed
|
||||
# steps:
|
||||
# - name: Check out code
|
||||
# uses: actions/checkout@v3
|
||||
# - name: Bump version and push tag
|
||||
# id: bump_version_and_push_tag
|
||||
# uses: anothrNick/github-tag-action@1.34.0
|
||||
# env:
|
||||
# GITHUB_TOKEN: ${{ secrets.PAT_FOR_CROSS_REPOS_CICD_TRIGGERING }}
|
||||
# WITH_V: true
|
||||
# DEFAULT_BUMP: 'minor' # or 'minor' or 'major'
|
||||
# - name: Create Release
|
||||
# id: create_release
|
||||
# uses: actions/create-release@v1
|
||||
# env:
|
||||
# GITHUB_TOKEN: ${{ secrets.PAT_FOR_CROSS_REPOS_CICD_TRIGGERING }}
|
||||
# with:
|
||||
# tag_name: ${{ steps.bump_version_and_push_tag.outputs.tag }}
|
||||
# release_name: Release ${{ steps.bump_version_and_push_tag.outputs.tag }}
|
||||
|
||||
outputs:
|
||||
cognee_image_tag: ${{ steps.export-promethai-docker-tag.outputs.cognee_image_tag }}
|
||||
|
||||
trigger_deployment:
|
||||
name: Trigger deployment
|
||||
runs-on: ubuntu-latest
|
||||
needs: publish_docker_to_ecr
|
||||
steps:
|
||||
- name: TF apply workflow triggers step
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
github-token: ${{ secrets.PAT_FOR_CROSS_REPOS_CICD_TRIGGERING }}
|
||||
script: |
|
||||
await github.rest.actions.createWorkflowDispatch({
|
||||
owner: 'topoteretes',
|
||||
repo: 'cognee-infra',
|
||||
workflow_id: 'terraform.apply.yml',
|
||||
ref: 'main'
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue