Update Traefik to fix docker daemon errors (#245) #71
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deployment | |
| # The deployment workflow should only run when changes are merged into the `main` branch. | |
| # Since a branch protection rule prevents directly pushing to `main` this workflow will | |
| # only run on a successful merge request. | |
| on: | |
| push: | |
| branches: | |
| - main | |
| # Allow the workflow to be manually triggered from the Actions tab. | |
| workflow_dispatch: | |
| jobs: | |
| # Build and test the distribution before deploying to the various platforms. This allows | |
| # us to store the build artifacts and reuse them in the deployment jobs below. | |
| build: | |
| name: Build Distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set Up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.x' | |
| - name: Install Poetry | |
| uses: abatilo/actions-poetry@v4 | |
| - name: Cache Virtual Environment | |
| uses: actions/cache@v4 | |
| with: | |
| path: ./.venv | |
| key: venv-${{ hashFiles('poetry.lock') }} | |
| - name: Install Dependencies | |
| run: poetry install | |
| # The tests should have already been run in the testing workflow, but we run them | |
| # again here to make sure that we do not deploy a broken distribution. | |
| - name: Run Tests | |
| run: poetry run pytest tests/mock/ | |
| # Once the tests have passsed we can build the distribution and store it, so it can | |
| # be accessed in the jobs below. | |
| - name: Build Distribution | |
| run: poetry build | |
| - name: Store Distribution | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: package-dist | |
| path: dist/ | |
| # The development distribution is a snapshot of the package and is deployed each time | |
| # changes are merged into the main branch. | |
| deploy-dev: | |
| name: Publish Development Distribution | |
| runs-on: ubuntu-latest | |
| # The distribution will only be published if the tests have passed. | |
| needs: | |
| - build | |
| # Set up the environment for trusted publishing on PyPI. | |
| environment: | |
| name: development | |
| url: https://test.pypi.org/p/cwms-python | |
| permissions: | |
| id-token: write # IMPORTANT: mandatory for trusted publishing | |
| steps: | |
| - name: Download Distribution | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: package-dist | |
| path: dist/ | |
| - name: Publish Distribution To Test PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ |