CI: split document and publish steps, and skip publish in forks.
This commit is contained in:
		
							parent
							
								
									4398575322
								
							
						
					
					
						commit
						4f70cd6294
					
				
							
								
								
									
										19
									
								
								.github/workflows/main.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										19
									
								
								.github/workflows/main.yaml
									
									
									
									
										vendored
									
									
								
							|  | @ -71,6 +71,21 @@ jobs: | |||
|       - name: Build documentation | ||||
|         run: | | ||||
|           sphinx-build docs docs/_build | ||||
|       - name: Upload documentation archive | ||||
|         uses: actions/upload-artifact@v3 | ||||
|         with: | ||||
|           name: docs | ||||
|           path: docs/_build | ||||
|   publish-docs: | ||||
|     needs: document | ||||
|     if: github.repository == 'amaranth-lang/amaranth' | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|       - name: Download documentation archive | ||||
|         uses: actions/download-artifact@v3 | ||||
|         with: | ||||
|           name: docs | ||||
|           path: docs/ | ||||
|       - name: Publish development documentation | ||||
|         if: github.event_name == 'push' && github.event.ref == 'refs/heads/main' | ||||
|         uses: JamesIves/github-pages-deploy-action@releases/v4 | ||||
|  | @ -78,7 +93,7 @@ jobs: | |||
|           repository-name: amaranth-lang/amaranth-lang.github.io | ||||
|           ssh-key: ${{ secrets.PAGES_DEPLOY_KEY }} | ||||
|           branch: main | ||||
|           folder: docs/_build | ||||
|           folder: docs/ | ||||
|           target-folder: docs/amaranth/latest/ | ||||
|       - name: Extract release version | ||||
|         if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | ||||
|  | @ -90,5 +105,5 @@ jobs: | |||
|           repository-name: amaranth-lang/amaranth-lang.github.io | ||||
|           ssh-key: ${{ secrets.PAGES_DEPLOY_KEY }} | ||||
|           branch: main | ||||
|           folder: docs/_build | ||||
|           folder: docs/ | ||||
|           target-folder: docs/amaranth/v${{ env.VERSION }}/ | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Catherine
						Catherine