ci/depoly: depoly to production if tagging version
This commit is contained in:
		
							parent
							
								
									8ae0768c42
								
							
						
					
					
						commit
						51ad463562
					
				
					 1 changed files with 16 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -1,5 +1,10 @@
 | 
			
		|||
 | 
			
		||||
on: ['push']
 | 
			
		||||
on:
 | 
			
		||||
  push:
 | 
			
		||||
    branches:
 | 
			
		||||
      - master
 | 
			
		||||
    tags:
 | 
			
		||||
      - "v*"
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  depoly:
 | 
			
		||||
| 
						 | 
				
			
			@ -26,11 +31,19 @@ jobs:
 | 
			
		|||
      - name: Build Dist
 | 
			
		||||
        run: pnpm dist
 | 
			
		||||
 | 
			
		||||
      - name: Depoly to Cloudflare
 | 
			
		||||
      - name: Depoly to Preview
 | 
			
		||||
        uses: https://github.com/cloudflare/wrangler-action@v3
 | 
			
		||||
        with:
 | 
			
		||||
          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
 | 
			
		||||
          accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
 | 
			
		||||
          command: pages deploy --project-name=tututheapp dist
 | 
			
		||||
        if: "env.GITHUB_REF_NAME == 'master'"
 | 
			
		||||
        if: github.event.ref_type == 'branch'
 | 
			
		||||
 | 
			
		||||
      - name: Depoly to Production
 | 
			
		||||
        uses: https://github.com/cloudflare/wrangler-action@v3
 | 
			
		||||
        with:
 | 
			
		||||
          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
 | 
			
		||||
          accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
 | 
			
		||||
          command: pages deploy --project-name=tututheapp dist --branch=production
 | 
			
		||||
        if: github.event.ref_type == 'tag'
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue