Skip to content

Commit

Permalink
ci: add push branch event ci and cd
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnsonMao committed Jan 5, 2025
1 parent 651bcab commit 30d6bee
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/ci-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
branches:
- "**"
- "!dependabot/**"
push:
branches:
- "prod"
- "dev"
workflow_dispatch:

env:
Expand Down Expand Up @@ -106,10 +110,11 @@ jobs:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
command: pages deploy --branch=${{ github.event.pull_request.head.ref }}
command: pages deploy --branch=${{ github.event.pull_request.head.ref || github.ref_name }}

outputs:
preview-url: ${{ steps.deploy.outputs.pages-deployment-alias-url }}
deploy-env: ${{ steps.deploy.outputs.pages-environment }}

send_result:
name: Send Result
Expand Down Expand Up @@ -144,5 +149,5 @@ jobs:
with:
TYPE: success
TITLE: "✅ Build Succeeded"
DESCRIPTION: "Preview URL: ${{ needs.build_and_deploy.outputs.preview-url }}"
DESCRIPTION: "Preview URL: ${{ needs.build_and_deploy.outputs.preview-url }}\\nEnvironment: ${{ needs.build_and_deploy.outputs.deploy-env }})"
DISCORD_WEBHOOK_URL: ${{ secrets.SANDBOX_DISCORD_WEBHOOK_URL }}

0 comments on commit 30d6bee

Please sign in to comment.