From 752025f3ca60ab88b716ac38d1aef77f0fffeef5 Mon Sep 17 00:00:00 2001 From: Anh Nguyen Date: Mon, 21 Oct 2024 15:44:56 +0700 Subject: [PATCH] ci: trigger on build --- .github/workflows/cloudflare-pages-deploy.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cloudflare-pages-deploy.yml b/.github/workflows/cloudflare-pages-deploy.yml index b542197..9cf5dc8 100644 --- a/.github/workflows/cloudflare-pages-deploy.yml +++ b/.github/workflows/cloudflare-pages-deploy.yml @@ -1,6 +1,10 @@ name: Deploy Remote Configs on: + push: + branches: + - main + - dev workflow_dispatch: inputs: environment: @@ -16,7 +20,7 @@ jobs: deploy: runs-on: ubuntu-latest name: Deploy - environment: ${{ github.event.inputs.environment }} + environment: ${{ github.event.inputs.environment || (github.ref == 'refs/heads/main' && 'Production' || 'Development') }} steps: - name: Checkout configs folder uses: actions/checkout@v4 @@ -27,7 +31,7 @@ jobs: - name: Create version.json run: | - echo "{\"commit\": \"${{ github.sha }}\", \"environment\": \"${{ github.event.inputs.environment }}\"}" > configs/version.json + echo "{\"commit\": \"${{ github.sha }}\", \"environment\": \"${{ github.event.inputs.environment || (github.ref == 'refs/heads/main' && 'Production' || 'Development') }}\"}" > configs/version.json - name: Deploy to Cloudflare Pages uses: cloudflare/wrangler-action@v3