Skip to content

Commit

Permalink
Merge pull request #32 from bnb-chain/update/cicd1
Browse files Browse the repository at this point in the history
chore: Update cicd
  • Loading branch information
wenty22 authored Oct 21, 2024
2 parents 0d01304 + 144ec66 commit 3382fe0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
10 changes: 8 additions & 2 deletions .github/actions/alpha/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ inputs:
app-name:
description: 'app name'
required: true
npm-token:
description: 'npm token'
required: true
github-token:
description: 'github token'
required: true

runs:
using: composite
Expand All @@ -27,5 +33,5 @@ runs:
title: 'chore: Update versions'
cwd: '.release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ inputs.github-token }}
NPM_TOKEN: ${{ inputs.npm-token }}
17 changes: 14 additions & 3 deletions .github/actions/gh-pages/action.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
name: github-pages-cicd

inputs:
server-endpoint:
description: 'server endpoint'
required: true
wallet-connect-project-id:
description: 'wallet connect project id'
required: true
api-token-github:
description: 'api token github'
required: true

runs:
using: composite
steps:
Expand All @@ -17,8 +28,8 @@ runs:
APP_NAME: canonical-bridge
BASE_PATH: /canonical-bridge
ASSET_PREFIX: /canonical-bridge
SERVER_ENDPOINT: ${{ vars.SERVER_ENDPOINT }}
WALLET_CONNECT_PROJECT_ID: ${{ vars.WALLET_CONNECT_PROJECT_ID }}
SERVER_ENDPOINT: ${{ inputs.server-endpoint }}
WALLET_CONNECT_PROJECT_ID: ${{ inputs.wallet-connect-project-id }}

- name: Install & build
shell: bash
Expand All @@ -29,7 +40,7 @@ runs:
- name: Pushes to another repository
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
API_TOKEN_GITHUB: ${{ inputs.api-token-github }}
with:
source-directory: './apps/canonical-bridge-ui/dist'
destination-github-username: 'wenty22'
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/qa-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,23 @@ jobs:
- 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 }}

0 comments on commit 3382fe0

Please sign in to comment.