Skip to content

Commit

Permalink
Working version of Compile course Github action
Browse files Browse the repository at this point in the history
  • Loading branch information
ZelenyMartin committed Aug 23, 2024
1 parent 8a07c27 commit c7595ee
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,16 @@ jobs:
poetry install -E ghp-compiled
- name: Compile the courses
run: |
for slug in pyladies mi-pyt meta lessons; do
poetry run python -m naucse_render compile _compiled/$slug --slug $slug \
poetry run python -m naucse_render compile _compiled \
--edit-repo-url https://github.com/${{ github.repository }} \
--edit-repo-branch main
done
- if: ${{ github.ref == 'refs/heads/main' }}
--edit-repo-branch ${{ github.ref_name }}
- if: ${{ startsWith(github.ref, 'refs/heads/') }}
name: Publish compiled courses
run: |
git fetch origin compiled || :
poetry run python -m ghp_import -m "Compiled" -b compiled --push _compiled/
git fetch origin compiled/${{ github.ref_name }} || :
poetry run python -m ghp_import -m "Compiled" -b compiled/${{ github.ref_name }} --push _compiled/
curl -H 'Content-Type: application/json' \
--data '{"repository": "https://github.com/${{ github.repository }}", "branch": "compiled"}' \
--data '{"repository": "https://github.com/${{ github.repository }}", "branch": "compiled/${{ github.ref_name }}"}' \
https://hooks.nauc.se/trigger
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit c7595ee

Please sign in to comment.