Skip to content

Commit 4d586c2

Browse files
committed
GHA: Compile from branch
1 parent 8a07c27 commit 4d586c2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

.github/workflows/main.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,14 @@ jobs:
2828
poetry install -E ghp-compiled
2929
- name: Compile the courses
3030
run: |
31-
for slug in pyladies mi-pyt meta lessons; do
32-
poetry run python -m naucse_render compile _compiled/$slug --slug $slug \
31+
poetry run python -m naucse_render compile _compiled \
3332
--edit-repo-url https://github.com/${{ github.repository }} \
34-
--edit-repo-branch main
35-
done
36-
- if: ${{ github.ref == 'refs/heads/main' }}
33+
--edit-repo-branch ${{ github.ref_name }}
34+
- if: ${{ startsWith(github.ref, 'refs/heads/') }}
3735
name: Publish compiled courses
3836
run: |
39-
git fetch origin compiled || :
40-
poetry run python -m ghp_import -m "Compiled" -b compiled --push _compiled/
37+
git fetch origin compiled/${{ github.ref_name }} || :
38+
poetry run python -m ghp_import -m "Compiled" -b compiled/${{ github.ref_name }} --push _compiled/
4139
curl -H 'Content-Type: application/json' \
4240
--data '{"repository": "https://github.com/${{ github.repository }}", "branch": "compiled"}' \
4341
https://hooks.nauc.se/trigger

0 commit comments

Comments
 (0)