From 850156ebb77095bb27ac053e9cb40a2ed2a318fc Mon Sep 17 00:00:00 2001 From: Jay Date: Mon, 4 Mar 2024 19:55:40 +0800 Subject: [PATCH] Deployment CI (#6) * ci: deployment * CI --------- Co-authored-by: fewensa <37804932+fewensa@users.noreply.github.com> --- .github/workflows/deploy-dev.yml | 46 ++++++++++++++++++++++++++++++++ .github/workflows/deploy-prd.yml | 46 ++++++++++++++++++++++++++++++++ .github/workflows/deploy-stg.yml | 44 ++++++++++++++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 .github/workflows/deploy-dev.yml create mode 100644 .github/workflows/deploy-prd.yml create mode 100644 .github/workflows/deploy-stg.yml diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml new file mode 100644 index 000000000..432637f96 --- /dev/null +++ b/.github/workflows/deploy-dev.yml @@ -0,0 +1,46 @@ +name: Deploy development + +on: + pull_request: + +jobs: + deploy-package: + name: Deploy package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: actions/checkout@v3 + with: + repository: darwinia-network/devops + path: .github + + - uses: ./.github/actions/smart-vercel + name: Deploy mainnet + with: + vercel_token: ${{ secrets.VERCEL_TOKEN }} + vercel_group: itering + preview_output: true + alias_domain: "helix-xtoken-dev" + project_name: "helix-xtoken-ui" + script_run: false + dist_path: . + enable_notify_comment: true + enable_notify_slack: true + slack_channel: helix-ui + slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }} + + - uses: ./.github/actions/smart-vercel + name: Deploy testnet + with: + vercel_token: ${{ secrets.VERCEL_TOKEN }} + vercel_group: itering + preview_output: true + alias_domain: "helix-xtoken-dev-test" + project_name: "helix-xtoken-ui-test" + script_run: false + dist_path: . + enable_notify_comment: true + enable_notify_slack: true + slack_channel: helix-ui + slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }} diff --git a/.github/workflows/deploy-prd.yml b/.github/workflows/deploy-prd.yml new file mode 100644 index 000000000..2c6e30449 --- /dev/null +++ b/.github/workflows/deploy-prd.yml @@ -0,0 +1,46 @@ +name: Deploy production + +on: + push: + tags: + - "v*" + +jobs: + deploy-package: + name: Deploy package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: actions/checkout@v3 + with: + repository: darwinia-network/devops + path: .github + + - uses: ./.github/actions/smart-vercel + name: Deploy mainnet + with: + vercel_token: ${{ secrets.VERCEL_TOKEN }} + vercel_group: itering + preview_output: true + prod_mode: true + project_name: "helix-xtoken-ui" + script_run: false + dist_path: . + enable_notify_slack: true + slack_channel: helix-ui + slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }} + + - uses: ./.github/actions/smart-vercel + name: Deploy testnet + with: + vercel_token: ${{ secrets.VERCEL_TOKEN }} + vercel_group: itering + preview_output: true + alias_domain: "helix-xtoken-prd-test" + project_name: "helix-xtoken-ui-test" + script_run: false + dist_path: . + enable_notify_slack: true + slack_channel: helix-ui + slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }} diff --git a/.github/workflows/deploy-stg.yml b/.github/workflows/deploy-stg.yml new file mode 100644 index 000000000..c8223075a --- /dev/null +++ b/.github/workflows/deploy-stg.yml @@ -0,0 +1,44 @@ +name: Deploy staging + +on: + workflow_dispatch: + +jobs: + deploy-package: + name: Deploy package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: actions/checkout@v3 + with: + repository: darwinia-network/devops + path: .github + + - uses: ./.github/actions/smart-vercel + name: Deploy mainnet + with: + vercel_token: ${{ secrets.VERCEL_TOKEN }} + vercel_group: itering + preview_output: true + alias_domain: "helix-xtoken-stg" + project_name: "helix-xtoken-ui" + script_run: false + dist_path: . + enable_notify_slack: true + slack_channel: helix-ui + slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }} + + - uses: ./.github/actions/smart-vercel + name: Deploy testnet + with: + vercel_token: ${{ secrets.VERCEL_TOKEN }} + vercel_group: itering + preview_output: true + alias_domain: "helix-xtoken-stg-test" + project_name: "helix-xtoken-ui-test" + script_run: false + dist_path: . + enable_notify_slack: true + slack_channel: helix-ui + slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}