Skip to content

Commit

Permalink
Merge pull request #41 from bnb-chain/cicd1023v2
Browse files Browse the repository at this point in the history
chore: Update cicd
  • Loading branch information
wenty22 authored Oct 23, 2024
2 parents 2925f96 + 7952a9a commit e7b4a1a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .github/actions/alpha/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ inputs:
github-token:
description: 'github token'
required: true
branch:
description: 'branch'
required: true

runs:
using: composite
Expand All @@ -32,6 +35,7 @@ runs:
commit: 'chore: Update versions'
title: 'chore: Update versions'
cwd: '.release'
branch: ${{ inputs.branch }}
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
NPM_TOKEN: ${{ inputs.npm-token }}
21 changes: 10 additions & 11 deletions .github/workflows/qa-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,16 @@ jobs:
- 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
BRANCH_NAME=${{ fromJSON(steps.get-pr.outputs.result).head.ref }}
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_OUTPUT
- name: Checkout code repository
uses: actions/checkout@v4
with:
Expand All @@ -70,25 +67,27 @@ jobs:
npm-token: ${{ secrets.NPM_TOKEN }}

- name: Deploy github pages
if: contains(steps.get-comment.outputs.APP_NAME, 'canonical-bridge-ui')
if: contains(steps.pr-env.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')
if: contains(steps.pr-env.outputs.APP_NAME, 'canonical-bridge-sdk')
uses: ./.github/actions/alpha
with:
app-name: ${{steps.get-comment.outputs.APP_NAME}}
app-name: ${{steps.pr-env.outputs.APP_NAME}}
npm-token: ${{ secrets.NPM_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ steps.pr-env.outputs.BRANCH_NAME }}

- name: Deploy Widget
if: contains(steps.get-comment.outputs.APP_NAME, 'canonical-bridge-widget')
if: contains(steps.pr-env.outputs.APP_NAME, 'canonical-bridge-widget')
uses: ./.github/actions/alpha
with:
app-name: ${{steps.get-comment.outputs.APP_NAME}}
app-name: ${{steps.pr-env.outputs.APP_NAME}}
npm-token: ${{ secrets.NPM_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ steps.pr-env.outputs.BRANCH_NAME }}

0 comments on commit e7b4a1a

Please sign in to comment.