Skip to content

Commit

Permalink
Merge pull request #126 from paraswap/feat/DVOPS-211
Browse files Browse the repository at this point in the history
DVOPS-211: Generate token instead of PAT
  • Loading branch information
ovceev authored Dec 2, 2024
2 parents adf1442 + 1ac8dfe commit 3dc65a5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/build-and-deploy-grp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,41 @@ 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:
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@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 }}
Expand All @@ -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
18 changes: 13 additions & 5 deletions .github/workflows/build-and-deploy-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,42 @@ on:
required: false
options:
- staging
- referrals
- orders

concurrency:
group: ${{ github.event_name }}-${{ github.event.inputs.target_env }}-service
cancel-in-progress: true

env:
service_name: volume-tracker
SERVICE_NAME: volume-tracker
GITHUB_CICD_APP_APP_ID: 1061706

jobs:
build-and-deploy-service:
name: Build and deploy service
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 }}
Expand All @@ -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

0 comments on commit 3dc65a5

Please sign in to comment.