From 4676b05357cd8909b17c03af91efebba2f2c0b15 Mon Sep 17 00:00:00 2001 From: Ilia Kovalev Date: Fri, 22 Nov 2024 16:53:42 +0100 Subject: [PATCH 1/2] build: generate token instead of ssh --- .github/workflows/build-and-deploy-grp.yml | 18 +++++++++++++----- .github/workflows/build-and-deploy-service.yml | 18 +++++++++++++----- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-and-deploy-grp.yml b/.github/workflows/build-and-deploy-grp.yml index 2c4bc935..55e0d4c1 100644 --- a/.github/workflows/build-and-deploy-grp.yml +++ b/.github/workflows/build-and-deploy-grp.yml @@ -14,14 +14,14 @@ on: options: - staging - orders - - referrals concurrency: group: ${{ github.event_name }}-${{ github.event.inputs.target_env }} cancel-in-progress: true env: - service_name: gas-refund-program + SERVICE_NAME: gas-refund-program + GITHUB_CICD_APP_APP_ID: 1061706 jobs: build-and-deploy-grp: @@ -29,18 +29,26 @@ jobs: runs-on: ubuntu-latest steps: + - name: Generate GitHub App Installation Token + id: installation-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ env.GITHUB_CICD_APP_APP_ID }} + private-key: ${{ secrets.CICD_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + - name: Checkout Composite Actions Repository uses: actions/checkout@v2 with: repository: paraswap/paraswap-github-actions ref: master - token: ${{ secrets.PARASWAP_GITHUB_ACTIONS_PAT }} + token: ${{ steps.installation-token.outputs.token }} path: .github/paraswap-github-actions - name: Build and deploy service using composite action uses: ./.github/paraswap-github-actions/build-and-deploy-service with: - service_name: ${{ env.service_name }} + service_name: ${{ env.SERVICE_NAME }} deploy_service: false repository_sha: ${{ github.sha}} event_name: ${{ github.event_name }} @@ -57,5 +65,5 @@ jobs: with: repository: paraswap/paraswap-github-actions ref: master - token: ${{ secrets.PARASWAP_GITHUB_ACTIONS_PAT }} + token: ${{ steps.installation-token.outputs.token }} path: .github/paraswap-github-actions diff --git a/.github/workflows/build-and-deploy-service.yml b/.github/workflows/build-and-deploy-service.yml index 38fa6d21..0ec26e47 100644 --- a/.github/workflows/build-and-deploy-service.yml +++ b/.github/workflows/build-and-deploy-service.yml @@ -13,7 +13,6 @@ on: required: false options: - staging - - referrals - orders concurrency: @@ -21,7 +20,8 @@ concurrency: cancel-in-progress: true env: - service_name: volume-tracker + SERVICE_NAME: gas-refund-program + GITHUB_CICD_APP_APP_ID: 1061706 jobs: build-and-deploy-service: @@ -29,18 +29,26 @@ jobs: runs-on: ubuntu-latest steps: + - name: Generate GitHub App Installation Token + id: installation-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ env.GITHUB_CICD_APP_APP_ID }} + private-key: ${{ secrets.CICD_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + - name: Checkout Composite Actions Repository uses: actions/checkout@v2 with: repository: paraswap/paraswap-github-actions ref: master - token: ${{ secrets.PARASWAP_GITHUB_ACTIONS_PAT }} + token: ${{ steps.installation-token.outputs.token }} path: .github/paraswap-github-actions - name: Build and deploy service using composite action uses: ./.github/paraswap-github-actions/build-and-deploy-service with: - service_name: ${{ env.service_name }} + service_name: ${{ env.SERVICE_NAME }} repository_sha: ${{ github.sha}} event_name: ${{ github.event_name }} authentication_token: ${{ secrets.AUTHENTICATION_KEY }} @@ -55,5 +63,5 @@ jobs: with: repository: paraswap/paraswap-github-actions ref: master - token: ${{ secrets.PARASWAP_GITHUB_ACTIONS_PAT }} + token: ${{ steps.installation-token.outputs.token }} path: .github/paraswap-github-actions From 1ac8dfeded90ec1922882301d35e112c7c2a5cf8 Mon Sep 17 00:00:00 2001 From: Ilia Kovalev <54960661+ovceev@users.noreply.github.com> Date: Fri, 22 Nov 2024 17:45:06 +0100 Subject: [PATCH 2/2] fix typo --- .github/workflows/build-and-deploy-service.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-deploy-service.yml b/.github/workflows/build-and-deploy-service.yml index 0ec26e47..8454fa98 100644 --- a/.github/workflows/build-and-deploy-service.yml +++ b/.github/workflows/build-and-deploy-service.yml @@ -20,7 +20,7 @@ concurrency: cancel-in-progress: true env: - SERVICE_NAME: gas-refund-program + SERVICE_NAME: volume-tracker GITHUB_CICD_APP_APP_ID: 1061706 jobs: