Skip to content

Commit c3e73ef

Browse files
author
a.pirogov
committed
trying to push to other repo
1 parent 93bb821 commit c3e73ef

4 files changed

Lines changed: 60 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,17 @@ jobs:
135135
fi
136136
poetry run mike deploy -u --push ${{ github.ref_name }} $SET_LATEST
137137
138-
publish:
138+
# ----
139+
140+
deploy_demo:
141+
# needs: docs
142+
# if: startswith(github.ref, 'refs/tags/v')
143+
secrets: inherit
144+
uses: "./.github/workflows/deploy_demo.yml"
145+
146+
publish_template:
139147
# if a version tag is pushed + tests + docs completed -> do release
140-
needs: docs
148+
needs: deploy_demo
141149
if: startswith(github.ref, 'refs/tags/v')
142150
permissions:
143151
contents: write # for GitHub release

.github/workflows/deploy_demo.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Deploy the demo repository
2+
3+
on: [workflow_dispatch, workflow_call]
4+
5+
jobs:
6+
deploy:
7+
if: github.event_name == 'push'
8+
runs-on: ubuntu-latest
9+
steps:
10+
11+
- name: Checkout template repo
12+
uses: actions/checkout@v3
13+
with:
14+
path: fair-python-cookiecutter
15+
16+
- name: Prepare SSH
17+
uses: webfactory/ssh-agent@v0.7.0
18+
with:
19+
ssh-private-key: ${{ secrets.SSH_DEPLOY_KEY }}
20+
21+
- name: Prepare git
22+
run: |
23+
git config --global user.email "deploy-fair-python-cookiecutter@example.com"
24+
git config --global user.name "Deployment Bot"
25+
26+
- uses: actions/setup-python@v4
27+
with:
28+
python-version: "3.10"
29+
30+
- name: Install poetry
31+
run: pipx install poetry
32+
33+
- name: Install cookiecutter
34+
run: pip install cookiecutter==2.1.1
35+
36+
- name: Instantiate demo repository
37+
run: |
38+
cookiecutter ./fair-python-cookiecutter --no-input --config-file=./fair-python-cookiecutter/tests/demo.yaml
39+
40+
- name: Deploy generated repository
41+
run: |
42+
cd fair-python-cookiecutter-demo
43+
git remote add origin git@github.com:Materials-Data-Science-and-Informatics/fair-python-cookiecutter-demo.git
44+
git push -f --set-upstream origin main

tests/proj1.yaml renamed to tests/demo.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ default_context:
44
__org_rep: "Stefan Sandfeld <s.sandfeld@fz-juelich.de>"
55
__org_gh: "Materials-Data-Science-and-Informatics"
66

7-
project_name: " My Amazing App "
7+
project_name: " FAIR Python Cookiecutter Demo "
88

99
project_version: "0.1.2"
10-
project_description: " An amazing application. "
11-
project_keywords: "awesome amazing fair"
10+
project_description: " Demo repository bootstrapped from the FAIR Python Cookiecutter template. "
11+
project_keywords: "fair python cookiecutter template"
1212

1313
project_license_spdx: "Unlicense"
1414

15-
author_last_name: "Researcher"
16-
author_first_name: "Famous"
15+
author_last_name: "Doe"
16+
author_first_name: "Jane"
1717
author_orcid: "0123-4567-8910-1112"
1818

1919
init_skel: "cli+api"

tests/test_template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def test_cookiecutter(gen):
8686

8787
# ----
8888
# generate with all demo code and different license
89-
dir = gen(config_file="./tests/proj1.yaml")
89+
dir = gen(config_file="./tests/demo.yaml")
9090
sanity_check_project(dir)
9191
# should have the code files
9292
assert (dir / "src/my_amazing_app/api.py").is_file()

0 commit comments

Comments
 (0)