forked from Koniverse/SubWallet-Extension
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
anhnhu
committed
May 14, 2024
1 parent
35e049a
commit 8efd903
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Build WebApp Preview | ||
on: | ||
pull_request: | ||
branches: | ||
- telegram-wallet | ||
|
||
push: | ||
branches: | ||
- telegram-wallet | ||
- telegram-dev-01 | ||
- telegram-dev-02 | ||
- telegram-dev-03 | ||
|
||
jobs: | ||
master: | ||
if: "! startsWith(github.event.head_commit.message, '[CI Skip]') || github.ref == 'refs/heads/telegram-wallet'" | ||
name: Deploy WebApp Preview | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.GH_PAT }} | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
cache: 'yarn' | ||
- name: Build | ||
env: | ||
TRANSAK_API_KEY: ${{ secrets.TRANSAK_API_KEY }} | ||
COINBASE_PAY_ID: ${{ secrets.COINBASE_PAY_ID }} | ||
NFT_MINTING_HOST: ${{ secrets.NFT_MINTING_HOST }} | ||
BRANCH_NAME: ${{ github.ref_name }} | ||
GAME_API_HOST: ${{ secrets.GAME_DEV_SERVER_1 }} | ||
run: | | ||
yarn install --immutable | grep -v 'YN0013' | ||
if [ ${{ github.ref_name }} == 'telegram-wallet' ]; then | ||
yarn run webapp:change-build-number | ||
fi | ||
yarn webapp:build --env GAME_API_HOST ${{ secrets.GAME_DEV_SERVER_1 }} | ||
- name: Publish to Cloudflare Pages | ||
id: cloudflare_deployment | ||
uses: cloudflare/pages-action@v1 | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
projectName: ${{ secrets.CLOUDFLARE_PAGES_PROJECT_NAME }} | ||
gitHubToken: ${{ secrets.GH_AUTOMATION_TOKEN }} | ||
branch: ${{ github.ref_name }} | ||
directory: './packages/webapp/build' | ||
wranglerVersion: '3' | ||
- if: "github.ref_name == 'telegram-wallet' && github.event_name == 'push'" | ||
name: Automation Bot | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
author_name: Automation Bot | ||
author_email: [email protected] | ||
message: '[CI Skip] Auto increase webapp build number' | ||
- name: Notify to Discord | ||
uses: sarisia/actions-status-discord@v1 | ||
if: always() | ||
with: | ||
webhook: ${{ secrets.DISCORD_WEBHOOK }} | ||
status: ${{ job.status }} | ||
username: WebApp Worker | ||
title: ${{ github.workflow }} | ||
description: | | ||
The deployment is completed. | ||
- URL: ${{ steps.cloudflare_deployment.outputs.url }} | ||
- Alias: ${{ steps.cloudflare_deployment.outputs.alias }} |