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..8454fa98 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: volume-tracker + 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