diff --git a/.github/workflows/deploy-pr.yml b/.github/workflows/deploy-pr.yml index fe14031..b513747 100644 --- a/.github/workflows/deploy-pr.yml +++ b/.github/workflows/deploy-pr.yml @@ -11,6 +11,8 @@ env: jobs: build-and-push-image: + outputs: + IMAGE_FULL_NAME: ${{ steps.meta.outputs.tags }} runs-on: ubuntu-latest steps: - name: Checkout repository @@ -41,3 +43,27 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + + update-kubenetes-manifest: + runs-on: ubuntu-latest + needs: [build-and-push-image] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Update fastapi-sample image + env: + IMAGE_FULL_NAME: ${{ needs.build-and-push-image.outputs.IMAGE_FULL_NAME }}}} + run: | + yq -i "(.spec.template.spec.containers[] | select(.name == \"fastapi-sample\")).image = \"$IMAGE_FULL_NAME"" manifest/fasta +pi-sample/deployment.yaml + + - name: Create PR + uses: peter-evans/create-pull-request@v5 + with: + base: main + title: "Upagete fasapi-sample" + draft: true + body: | + # Changes + - Upate 'fastapi-sample' image to ${{ needs.build-and-push-image.outputs.IMAGE_FULL_NAME }}