From 4e8a4e880dfb3fd0814975049468b552efec8373 Mon Sep 17 00:00:00 2001 From: Naka Masato Date: Wed, 5 Aug 2020 11:57:57 +0900 Subject: [PATCH] Create auto-pr.yml (#45) --- .github/workflows/auto-pr.yml | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/auto-pr.yml diff --git a/.github/workflows/auto-pr.yml b/.github/workflows/auto-pr.yml new file mode 100644 index 00000000..a026cb6f --- /dev/null +++ b/.github/workflows/auto-pr.yml @@ -0,0 +1,38 @@ +name: release + +on: + release: + types: [released] + +env: + IMAGE_NAME: usergram/gram-agent + +jobs: + build: + if: github.event.release.target_commitish == 'master' + name: Build and Push Docker Image + runs-on: ubuntu-latest + steps: + - name: Set env + run: | + echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:10}) + - uses: actions/checkout@v2 + with: + token: ${{ secrets.TEST_GITHUB_TOKEN }} + repository: nakamasato/k8s-deploy-test + - env: + NAMESPACE: eai-staging + run: | + sed -i "s#guestbook#GUESTBOOK#;" k8s-deploy-test/apps/guestbook/deployment.yaml + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + env: + NAMESPACE: test + with: + token: ${{ secrets.TEST_GITHUB_TOKEN }} + title: "[${{ env.NAMESPACE }}] Internal release test [${{ env.RELEASE_VERSION }}]" + body: | + # Why + - To perform internal release for test [${{ env.RELEASE_VERSION }}](https://github.com/nakamasato/github-actions-practice/releases/tag/${{ env.RELEASE_VERSION }}) + # What + - Change image tag of test for ${{ env.NAMESPACE }}