Skip to content

Commit

Permalink
Worflow séparé
Browse files Browse the repository at this point in the history
  • Loading branch information
linogaliana committed Jul 18, 2023
1 parent 143e706 commit 5bf852d
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 58 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/notebooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Production deployment

on:
push:
branches:
- main
- master

jobs:
enonces:
name: Render notebooks
runs-on: ubuntu-latest
container: linogaliana/python-datascientist:latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Configure safe.directory # Workaround for actions/checkout#760
run: |
git config --global --add safe.directory /__w/python-datascientist/python-datascientist
git config --global --add safe.directory /__w/python-datascientist/python-datascientist-notebooks
- shell: bash
run: |
ls
conda info
conda list
- name: Convert in ipynb with Quarto
run: |
find content/course -type f -name "*.qmd" >> diff
cat diff
python build/tweak_project.py
python build/tweak_render.py
python build/wc_website.py
python build/pimp_notebook.py
quarto render content --to ipynb
mkdir -p temp_notebooks
mkdir -p temp_notebooks/notebooks
python build/move_files.py temp_notebooks/notebooks
quarto render content --to ipynb --execute
mkdir -p temp_notebooks/corrections
python build/move_files.py temp_notebooks/corrections
- uses: actions/upload-artifact@v2
with:
name: Source enonce
path: content/
- uses: actions/upload-artifact@v2
with:
name: Enonces
path: temp_notebooks/notebooks/
- uses: actions/upload-artifact@v2
with:
name: Enonces
path: temp_notebooks/corrections/
- name: Pushes to another repository
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: 'temp_notebooks/'
destination-repository-username: 'linogaliana'
destination-repository-name: 'python-datascientist-notebooks'
user-email: lino.galiana@insee.fr
destination-github-username: linogaliana
#target-branch: test
create-target-branch-if-needed: true
#reset-repo: true
58 changes: 0 additions & 58 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,61 +37,3 @@ jobs:
with:
name: Website
path: public/
enonces:
name: Render notebooks
runs-on: ubuntu-latest
container: linogaliana/python-datascientist:latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Configure safe.directory # Workaround for actions/checkout#760
run: |
git config --global --add safe.directory /__w/python-datascientist/python-datascientist
git config --global --add safe.directory /__w/python-datascientist/python-datascientist-notebooks
- shell: bash
run: |
ls
conda info
conda list
- name: Convert in ipynb with Quarto
run: |
find content/course -type f -name "*.qmd" >> diff
cat diff
python build/tweak_project.py
python build/tweak_render.py
python build/wc_website.py
python build/pimp_notebook.py
quarto render content --to ipynb
mkdir -p temp_notebooks
mkdir -p temp_notebooks/notebooks
python build/move_files.py temp_notebooks/notebooks
quarto render content --to ipynb --execute
mkdir -p temp_notebooks/corrections
python build/move_files.py temp_notebooks/corrections
- uses: actions/upload-artifact@v2
with:
name: Source enonce
path: content/
- uses: actions/upload-artifact@v2
with:
name: Enonces
path: temp_notebooks/notebooks/
- uses: actions/upload-artifact@v2
with:
name: Enonces
path: temp_notebooks/corrections/
- name: Pushes to another repository
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: 'temp_notebooks/'
destination-repository-username: 'linogaliana'
destination-repository-name: 'python-datascientist-notebooks'
user-email: lino.galiana@insee.fr
destination-github-username: linogaliana
#target-branch: test
create-target-branch-if-needed: true
#reset-repo: true

0 comments on commit 5bf852d

Please sign in to comment.