File tree Expand file tree Collapse file tree 4 files changed +26
-8
lines changed
template/{% if git_platform=="github.com" %}.github{% endif %}/workflows Expand file tree Collapse file tree 4 files changed +26
-8
lines changed Original file line number Diff line number Diff line change 11on :
22 workflow_call :
3+ inputs :
4+ publish :
5+ type : boolean
6+ description : If true, pushes image to container registry
37
48jobs :
59 build :
4751 type=raw,value=latest
4852
4953 - name : Push cached image to container registry
50- if : github.ref_type == 'tag'
54+ if : inputs.publish && github.ref_type == 'tag'
5155 uses : docker/build-push-action@v6
5256 env :
5357 DOCKER_BUILD_RECORD_UPLOAD : false
Original file line number Diff line number Diff line change 11on :
22 workflow_call :
3+ inputs :
4+ publish :
5+ type : boolean
6+ description : If true, publishes docs to gh-pages
7+
38
49jobs :
510 build :
4449 run : python .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} .github/pages/switcher.json
4550
4651 - name : Publish Docs to gh-pages
47- if : github.ref_type == 'tag' || github.ref_name == 'main'
52+ if : inputs.publish && ( github.ref_type == 'tag' || github.ref_name == 'main')
4853 # We pin to the SHA, not the tag, for security reasons.
4954 # https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
5055 uses : peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
Original file line number Diff line number Diff line change 2424
2525 docs :
2626 uses : ./.github/workflows/_docs.yml
27+ with :
28+ publish : ${{needs.test.result == 'success'}}
2729 permissions :
2830 contents : write
2931
3537 EXAMPLE_DEPLOY_KEY : ${{ secrets.EXAMPLE_DEPLOY_KEY }}
3638
3739 release :
40+ needs : [test, docs]
3841 if : github.ref_type == 'tag'
39- needs : docs
4042 uses : ./.github/workflows/_release.yml
4143 permissions :
4244 contents : write
Original file line number Diff line number Diff line change @@ -27,29 +27,36 @@ jobs:
2727 python-version: ${{ matrix.python-version }}
2828 secrets:
2929 CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
30- {% endraw %}{% if docker %}
30+ {% endraw %}{% if docker %}{% raw %}
3131 container:
32+ needs: test
33+ if: always()
3234 uses: ./.github/workflows/_container.yml
35+ with:
36+ publish: ${{ needs.test.result == 'success' }}
3337 permissions:
3438 contents: read
3539 packages: write
36- {% endif %}{% if sphinx %}
40+ {% endraw %}{% endif %}{% if sphinx %}{% raw %}
3741 docs:
3842 uses: ./.github/workflows/_docs.yml
39- {% endif %}
43+ with:
44+ publish: ${{ needs.test.result == 'success' }}
45+
46+ {% endraw %}{% endif %}
4047 dist:
4148 uses: ./.github/workflows/_dist.yml
4249 {% if pypi %}
4350 pypi:
51+ needs: [dist, test]
4452 if: github.ref_type == 'tag'
45- needs: dist
4653 uses: ./.github/workflows/_pypi.yml
4754 permissions:
4855 id-token: write
4956 {% endif %}
5057 release:
58+ needs: [dist, test{% if sphinx %} , docs{% endif %} ]
5159 if: github.ref_type == 'tag'
52- needs: [dist{% if sphinx %} , docs{% endif %} ]
5360 uses: ./.github/workflows/_release.yml
5461 permissions:
5562 contents: write
You can’t perform that action at this time.
0 commit comments