diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..405f6cb --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,44 @@ +name: release +on: + push: + tags: ['v*'] +permissions: + contents: write + packages: write +jobs: + build-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: { python-version: '3.12' } + - name: Build + run: | + python -m pip install -U pip build + python -m build + - uses: actions/upload-artifact@v4 + with: { name: dist, path: dist/* } + - name: Publish to PyPI + if: startsWith(github.ref, 'refs/tags/v') && secrets.PYPI_API_TOKEN != '' + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + publish-ghcr: + needs: build-publish + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ghcr.io/${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:${{ github.ref_name }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..457e7bc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM python:3.12-slim +WORKDIR /app +COPY . /app +RUN pip install --no-cache-dir . +ENTRYPOINT ["python","-m","diff_risk_dashboard"]