diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5869563..153e301 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: Test -on: [push, pull_request, release] +on: [push, pull_request, workflow_call] jobs: qa: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..2b13fae --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,27 @@ +on: [release] + +jobs: + test: + uses: ./.github/workflows/ci.yml + + # publish: + # runs-on: ubuntu-latest + # needs: test + # # The following steps to build a Docker image and publish to the GitHub container registry on release. Alternatively, can replace with other publising steps (ie. publishing to PyPI, deploying documentation etc.) + # steps: + # - name: Login to GitHub Container Registry + # uses: docker/login-action@v3 + # with: + # registry: ghcr.io + # username: ${{ github.actor }} + # password: ${{ secrets.GITHUB_TOKEN }} + # - name: Get image metadata + # id: meta + # uses: docker/metadata-action@v5 + # with: + # images: ghcr.io/${{ github.repository }} + # - name: Build and push Docker image + # uses: docker/build-push-action@v5 + # with: + # push: true + # tags: ${{ steps.meta.outputs.tags }} diff --git a/README.md b/README.md index a50b744..9715596 100644 --- a/README.md +++ b/README.md @@ -80,3 +80,8 @@ for this are: - Note that `pre-commit.ci` is an external service and free for open source repos. For private repos uncomment the commented portion of the `pre-commit_autoupdate.yml` workflow. [`pip-tools`]: https://pip-tools.readthedocs.io/en/latest/ + +### Publishing + +The GitHub workflow includes an action to publish on release. +To run this action, uncomment the commented portion of `publish.yml`, and modify the steps for the desired behaviour (publishing a Docker image, publishing to PyPI, deploying documentation etc.)