Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,24 @@ jobs:
# Need this to get version number from last tag
fetch-depth: 0

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

- name: Rewrite copier answers
- name: Regenerate example
run: |
sed -i 's|_src_path: .|_src_path: https://github.com/DiamondLightSource/python-copier-template.git|' example/.copier-answers.yml

git init /tmp/example
uvx copier copy --data-file example-answers.yml --vcs-ref=HEAD . /tmp/example
sed -i 's|_src_path: .|_src_path: https://github.com/DiamondLightSource/python-copier-template.git|' /tmp/example/.copier-answers.yml
uv lock --directory /tmp/example
rm -rf /tmp/example/.git

- name: Publish example
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
deploy_key: ${{ secrets.EXAMPLE_DEPLOY_KEY }}
publish_dir: example
publish_dir: /tmp/example
external_repository: DiamondLightSource/python-copier-template-example
publish_branch: main
enable_jekyll: true # don't put a .nojekyll
Expand Down