Skip to content

Make Demo Repo

Make Demo Repo #48

# This workflows will create a new demo repository using PyScaffold for demonstration purposes
name: Make Demo Repo
on:
workflow_dispatch:
jobs:
make-demo:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
path: ./repo
fetch-depth: 0 # avoids shallow checkout as needed by setuptools-scm
- name: Set up Conda environment
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: "pyscaffold"
environment-file: ./repo/environment.yml
auto-update-conda: true
auto-activate-base: false
- name: Setup steps
working-directory: ./repo # to avoid nested git problem
run: |
pip install -e . # otherwise templates are not packaged
git config --global user.email "[email protected]"
git config --global user.name "Github Action"
- name: Build and create demo
run: |
putup demo-dsproject --dsproject -d "Demonstration of a project generated with the Data Science project extension of PyScaffold" -u https://github.com/pyscaffold/pyscaffoldext-dsproject -l MIT
cd demo-dsproject
echo -e "[![ReadTheDocs](https://readthedocs.org/projects/dsproject-demo/badge/?version=latest)](https://dsproject-demo.readthedocs.io/)\n$(cat README.md)" > README.md
rm -rf .git # for github-action-push-to-another-repository to work
- name: Push to dsproject-demo
uses: cpina/github-action-push-to-another-repository@devel
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: "demo-dsproject/"
destination-github-username: "FlorianWilhelm"
destination-repository-username: "pyscaffold"
destination-repository-name: "dsproject-demo"
user-email: [email protected]
commit-message: "Initial commit"
target-branch: master