diff --git a/.github/workflows/publishing.yml b/.github/workflows/publishing.yml index 1d40c3c3..24d39b46 100644 --- a/.github/workflows/publishing.yml +++ b/.github/workflows/publishing.yml @@ -1,11 +1,9 @@ name: Publishing -#on: -# push: -# tags: -# - '*' - -on: [push, pull_request, workflow_dispatch] +on: + push: + tags: + - '*' jobs: @@ -101,27 +99,29 @@ jobs: - uses: pypa/gh-action-pypi-publish@master with: user: __token__ - password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository_url: https://test.pypi.org/legacy/ + password: ${{ secrets.PYPI_API_TOKEN }} + # For publishing to Test PyPI, uncomment next two lines: + # password: ${{ secrets.TEST_PYPI_API_TOKEN }} + # repository_url: https://test.pypi.org/legacy/ -# publish-docs: -# name: Publish docs -# needs: [publish] -# runs-on: ubuntu-18.04 -# steps: -# - uses: actions/checkout@v2 -# - uses: actions/setup-python@v2 -# with: -# python-version: "3.10" -# - run: pip install -r requirements-doc.txt -# - run: pip install awscli -# - run: pip install -e . -# - run: (cd docs && make clean html) -# - run: | -# aws s3 sync docs/_build/html s3://python-dependency-injector-docs --delete -# aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --path "/*" > /dev/null -# echo "Cache invalidation triggered" -# env: -# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} -# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} -# AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + publish-docs: + name: Publish docs + needs: [publish] + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: "3.10" + - run: pip install -r requirements-doc.txt + - run: pip install awscli + - run: pip install -e . + - run: (cd docs && make clean html) + - run: | + aws s3 sync docs/_build/html s3://python-dependency-injector-docs --delete + aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --path "/*" > /dev/null + echo "Cache invalidation triggered" + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}