Merge pull request #137 from VeloraDEX/feat/DVOPS-344 #232
This file contains hidden or 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: Build and deploy Gas Refund Program | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| inputs: | |
| target_env: | |
| type: choice | |
| description: Target environment | |
| default: staging | |
| required: false | |
| options: | |
| - staging | |
| - orders | |
| permissions: | |
| id-token: write # This is required for requesting the JWT | |
| contents: read | |
| concurrency: | |
| group: ${{ github.event_name }}-${{ github.event.inputs.target_env }} | |
| cancel-in-progress: true | |
| env: | |
| SERVICE_NAME: gas-refund-program | |
| GITHUB_CICD_APP_APP_ID: 1061706 | |
| jobs: | |
| build-and-deploy-grp: | |
| name: Build and deploy gas refund program | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate GitHub App Installation Token | |
| id: installation-token | |
| uses: actions/create-github-app-token@v2 | |
| 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@v4 | |
| with: | |
| repository: paraswap/paraswap-github-actions | |
| ref: master | |
| 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 }} | |
| deploy_service: false | |
| repository_sha: ${{ github.sha}} | |
| event_name: ${{ github.event_name }} | |
| role_to_assume: ${{ secrets.CI_ROLE_TO_ASSUME }} | |
| data_center: ${{ secrets.DATA_CENTER }} | |
| dockerfile_location: Dockerfile.grp | |
| target_env: ${{ github.event.inputs.target_env }} | |
| # We re-checkout composite actions repository due to a known bug that if composite action does its own checkout, it deletes any previous checkouts | |
| # thus, the post action fails on not finding the composite action we checked-out. See: https://github.com/actions/runner/issues/1300 | |
| - name: ReCheckout Composite Actions Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: paraswap/paraswap-github-actions | |
| ref: master | |
| token: ${{ steps.installation-token.outputs.token }} | |
| path: .github/paraswap-github-actions |