Merge pull request #127 from Kong/create-pull-request/patch #74
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
name: Stage Kong changes for PRD in a PR | |
on: | |
push: | |
branches: | |
- main | |
- workflow/** | |
paths: | |
- platform/kong/.generated/kong.yaml | |
- .github/workflows/stage-kong-for-PRD.yaml | |
jobs: | |
# this job is useful to debug workflows, see https://github.com/mheap/debug-artifact | |
# debug-artifacts: | |
# name: Upload Debug Artifacts | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Upload Debug Artifacts | |
# uses: mheap/debug-artifact@v1 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
stage-kong-for-prd: | |
name: Stage Kong changes for PRD | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup deck | |
uses: kong/setup-deck@v1 | |
with: | |
deck-version: '1.26.0' | |
wrapper: false | |
- name: stage combined file for PRD | |
run: cp platform/kong/.generated/kong.yaml PRD/kong/kong.yaml | |
- name: deck diff | |
id: deck-diff | |
# deck diff results in a multi-line output, which requires some | |
# bash gymnastics to handle and pass through to the next job. | |
# See: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-of-a-multiline-string | |
run: | | |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) | |
echo "DIFF<<$EOF" >> $GITHUB_ENV | |
deck diff --select-tag platform-repo-managed -s PRD/kong/kong.yaml --konnect-runtime-group-name KongAir-PRD --konnect-token ${{ secrets.KONNECT_PAT }} >> $GITHUB_ENV | |
echo "$EOF" >> $GITHUB_ENV | |
- name: Create PR to stage changes for the Kong Gateway in production | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
title: "❗PRD❗: Staged changes for Kong Gateway PRD deployment" | |
branch: "PRD/kong" | |
labels: "PRD,kong" | |
body: "Merging this PR will result in the following changes deployed to PRD \n\n ```\n${{env.DIFF}}\n```" | |