-
Notifications
You must be signed in to change notification settings - Fork 9
38 lines (34 loc) · 1.37 KB
/
_example.yml
File metadata and controls
38 lines (34 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
on:
workflow_call:
secrets:
EXAMPLE_DEPLOY_KEY:
required: true
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
# Need this to get version number from last tag
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Regenerate example
run: |
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: /tmp/example
external_repository: DiamondLightSource/python-copier-template-example
publish_branch: main
enable_jekyll: true # don't put a .nojekyll
exclude_assets: '' # default would exclude .github