Skip to content

Commit 3a5c555

Browse files
committed
ci: docker release step
1 parent 6113d16 commit 3a5c555

File tree

1 file changed

+37
-20
lines changed

1 file changed

+37
-20
lines changed

.github/workflows/CICD.yml

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,13 @@ jobs:
4141
uses: astral-sh/setup-uv@v5
4242

4343
- name: Export requirements
44-
run: uv export --python=${{ matrix.python-version }} --format requirements.txt -o requirements.txt --no-emit-workspace --group check --group check_mkdocstrings
44+
run: uv export \
45+
--python=${{ matrix.python-version }} \
46+
--format requirements.txt -o requirements.txt \
47+
--no-emit-workspace \
48+
--group check \
49+
--group check_mkdocstrings \
50+
--group docs
4551

4652
- name: Set up Docker Buildx
4753
uses: docker/setup-buildx-action@v3
@@ -65,7 +71,7 @@ jobs:
6571
run: |
6672
# We beed to mount the whole repo ... so we make a volume from . to /mkquartodocs
6773
docker run --rm -v ${PWD}:/mkquartodocs -t mkquartodocs-test:${{ matrix.python-version }} \
68-
python -m mkdocs build --strict
74+
bash -c "pip install '.[docs]' && python -m mkdocs build --strict"
6975
7076
release:
7177
# Run when there is a new push on the release branch
@@ -78,37 +84,48 @@ jobs:
7884
uses: softprops/action-gh-release@v2
7985
if: startsWith(github.ref, 'refs/tags/')
8086

81-
# Documentation setup
82-
- name: Setup Quarto
83-
uses: quarto-dev/quarto-actions/setup@v2
84-
- name: View Quarto version
85-
run: quarto --version
86-
87-
# Python setup
88-
- name: Install uv and set the python version
87+
- name: Install uv
8988
uses: astral-sh/setup-uv@v5
90-
with:
91-
python-version: '3.12'
9289

93-
- name: View Python --version
94-
run: uv run python --version
90+
- name: Export requirements
91+
run: uv export \
92+
--python=3.13 \
93+
--format requirements.txt -o requirements.txt \
94+
--no-emit-workspace \
95+
--group check \
96+
--group check_mkdocstrings \
97+
--group docs
9598

96-
- name: Build package
97-
run: |
98-
uv run --all-groups python -m build
99+
- name: Set up Docker Buildx
100+
uses: docker/setup-buildx-action@v3
101+
102+
- name: Build Docker release image
103+
uses: docker/build-push-action@v6
104+
with:
105+
context: .
106+
file: tests/Dockerfile.test
107+
platforms: linux/amd64
108+
build-args: IMAGE=python:3.13-slim
109+
tags: mkquartodocs-release:latest
110+
load: true
111+
cache-from: type=gha
112+
cache-to: type=gha,mode=max
99113

100114
# Publishing Docs
101115
- name: Deploy Docs
102116
run: |
103-
uv run python -m mkdocs gh-deploy --strict --force
117+
docker run --rm -v ${PWD}:/mkquartodocs -t mkquartodocs-release:latest \
118+
bash -c "pip install '.[docs]' && python -m mkdocs gh-deploy --strict --force"
104119
105120
- name: Build package
106121
run: |
107-
docker build -f tests/Dockerfile.test -m build
122+
docker run --rm -v ${PWD}:/mkquartodocs -t mkquartodocs-release:latest \
123+
bash -c "pip install build && python -m build"
108124
109125
- name: Publish to PyPI
110126
env:
111127
TWINE_USERNAME: __token__
112128
TWINE_PASSWORD: ${{ secrets.PYPITOKEN }}
113129
run: |
114-
python -m twine upload --non-interactive dist/*
130+
docker run --rm -v ${PWD}:/mkquartodocs -t mkquartodocs-release:latest \
131+
bash -c "pip install twine && python -m twine upload --non-interactive dist/*"

0 commit comments

Comments
 (0)