Skip to content

Commit d0f3711

Browse files
committed
Run uv sync before pushing example code
1 parent ed290c8 commit d0f3711

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

.github/workflows/_example.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,25 @@ jobs:
1414
# Need this to get version number from last tag
1515
fetch-depth: 0
1616

17-
- name: Regenerate example
18-
run: |
19-
pipx run copier copy --data-file example-answers.yml --vcs-ref=HEAD . example
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v5
2019

21-
- name: Rewrite copier answers
20+
- name: Regenerate example
2221
run: |
23-
sed -i 's|_src_path: .|_src_path: https://github.com/DiamondLightSource/python-copier-template.git|' example/.copier-answers.yml
24-
22+
git init /tmp/example
23+
uvx copier copy --data-file example-answers.yml --vcs-ref=HEAD . /tmp/example
24+
sed -i 's|_src_path: .|_src_path: https://github.com/DiamondLightSource/python-copier-template.git|' /tmp/example/.copier-answers.yml
25+
uv lock --directory /tmp/example
26+
rm -rf /tmp/example/.git
27+
2528
- name: Publish example
2629
# We pin to the SHA, not the tag, for security reasons.
2730
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
2831
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
2932
with:
3033
deploy_key: ${{ secrets.EXAMPLE_DEPLOY_KEY }}
31-
publish_dir: example
34+
publish_dir: /tmp/example
3235
external_repository: DiamondLightSource/python-copier-template-example
33-
publish_branch: main
36+
publish_branch: example-test
3437
enable_jekyll: true # don't put a .nojekyll
3538
exclude_assets: '' # default would exclude .github

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828

2929
example:
3030
needs: test
31-
if: github.ref_name == 'main'
3231
uses: ./.github/workflows/_example.yml
3332
secrets:
3433
EXAMPLE_DEPLOY_KEY: ${{ secrets.EXAMPLE_DEPLOY_KEY }}

0 commit comments

Comments
 (0)