ci: fix fork preview
This commit is contained in:
		
							parent
							
								
									2acdec323f
								
							
						
					
					
						commit
						00e860d8e6
					
				| @ -36,11 +36,8 @@ jobs: | |||||||
|       - name: Build Quartz |       - name: Build Quartz | ||||||
|         run: npx quartz build -d docs -v |         run: npx quartz build -d docs -v | ||||||
| 
 | 
 | ||||||
|       - name: Publish to Cloudflare Pages |       - name: Upload build artifact | ||||||
|         uses: AdrianGonz97/refined-cf-pages-action@v1 |         uses: actions/upload-artifact@v4 | ||||||
|         with: |         with: | ||||||
|           apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} |           name: preview-build | ||||||
|           accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} |           path: public | ||||||
|           githubToken: ${{ secrets.GITHUB_TOKEN }} |  | ||||||
|           projectName: quartz |  | ||||||
|           directory: public |  | ||||||
							
								
								
									
										37
									
								
								.github/workflows/deploy-preview.yaml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								.github/workflows/deploy-preview.yaml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,37 @@ | |||||||
|  | name: Upload Preview Deployment | ||||||
|  | on: | ||||||
|  |   workflow_run: | ||||||
|  |     workflows: ["Build Preview Deployment"] | ||||||
|  |     types: | ||||||
|  |       - completed | ||||||
|  | 
 | ||||||
|  | permissions: | ||||||
|  |   actions: read | ||||||
|  |   deployments: write | ||||||
|  |   contents: read | ||||||
|  |   pull-requests: write | ||||||
|  | 
 | ||||||
|  | jobs: | ||||||
|  |   deploy-preview: | ||||||
|  |     if: ${{ github.repository == 'jackyzha0/quartz' && github.event.workflow_run.conclusion == 'success' }} | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     name: Deploy Preview to Cloudflare Pages | ||||||
|  |     steps: | ||||||
|  |       - name: Download build artifact | ||||||
|  |         uses: actions/download-artifact@v4 | ||||||
|  |         id: preview-build-artifact | ||||||
|  |         with: | ||||||
|  |           name: preview-build | ||||||
|  |           path: build | ||||||
|  |           github-token: ${{ secrets.GITHUB_TOKEN }} | ||||||
|  |           run-id: ${{ github.event.workflow_run.id }} | ||||||
|  | 
 | ||||||
|  |       - name: Deploy to Cloudflare Pages | ||||||
|  |         uses: AdrianGonz97/refined-cf-pages-action@v1 | ||||||
|  |         with: | ||||||
|  |           apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||||||
|  |           accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||||||
|  |           githubToken: ${{ secrets.GITHUB_TOKEN }} | ||||||
|  |           projectName: YOUR_PROJECT_NAME | ||||||
|  |           deploymentName: Preview | ||||||
|  |           directory: ${{ steps.preview-build-artifact.outputs.download-path }} | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user