Skip to content

feat: Tron support

feat: Tron support #7

Workflow file for this run

name: cicd-trigger-by-comment
on:
issue_comment:
types: [created]
jobs:
pre-check:
runs-on: ubuntu-latest
if: github.repository == 'bnb-chain/canonical-bridge' && contains(github.event.comment.body, '/qa-deploy')
outputs:
codeowners: ${{ steps.codeowners.outputs.content }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Read codeowners
id: codeowners
uses: juliangruber/read-file-action@v1
with:
path: .github/CODEOWNERS
cicd:
needs: [pre-check]
if: contains(needs.pre-check.outputs.codeowners, github.event.comment.user.login)
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v3
id: get-pr
with:
script: |
const request = {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
}
core.info(`Getting PR #${request.pull_number} from ${request.owner}/${request.repo}`)
try {
const result = await github.pulls.get(request)
return result.data
} catch (err) {
core.setFailed(`Request failed with error ${err}`)
}
- name: get pr env
id: pr-env
run: |
BRANCH_NAME=${{ fromJSON(steps.get-pr.outputs.result).head.ref }}
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_OUTPUT
- name: get comment
id: get-comment
run: |
#!/bin/bash
input_comment="${{ github.event.comment.body }}"
comment_format=${input_comment// /}
APP_NAME=${comment_format#*:}
echo "APP_NAME=${APP_NAME}" >> $GITHUB_OUTPUT
- name: Checkout code repository
uses: actions/checkout@v4
with:
ref: ${{ steps.pr-env.outputs.BRANCH_NAME }}
token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/setup
with:
npm-token: ${{ secrets.NPM_TOKEN }}
- name: Deploy github pages
if: contains(steps.get-comment.outputs.APP_NAME, 'canonical-bridge-ui')
uses: ./.github/actions/gh-pages
with:
server-endpoint: ${{ vars.SERVER_ENDPOINT }}
wallet-connect-project-id: ${{ vars.WALLET_CONNECT_PROJECT_ID }}
api-token-github: ${{ secrets.API_TOKEN_GITHUB }}
- name: Deploy SDK
if: contains(steps.get-comment.outputs.APP_NAME, 'canonical-bridge-sdk')
uses: ./.github/actions/alpha
with:
app-name: ${{steps.get-comment.outputs.APP_NAME}}
npm-token: ${{ secrets.NPM_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy Widget
if: contains(steps.get-comment.outputs.APP_NAME, 'canonical-bridge-widget')
uses: ./.github/actions/alpha
with:
app-name: ${{steps.get-comment.outputs.APP_NAME}}
npm-token: ${{ secrets.NPM_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}